home *** CD-ROM | disk | FTP | other *** search
MacBinary | 1995-09-07 | 30.6 KB | [TEXT/MPS ] |
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: MacBinary
(archive/macBinary).
Confidence | Program | Detection | Match Type | Support
|
---|
66%
| dexvert
| Compact Compressed (Unix) (archive/compact)
| ext
| Supported |
10%
| dexvert
| MacBinary (archive/macBinary)
| fallback
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| MacBinary II, inited, Thu Sep 7 16:16:34 1995, modified Thu Sep 7 16:16:34 1995, creator 'MPS ', type ASCII, 30520 bytes "Comments.c" , at 0x77b8 564 bytes resource
| default (weak)
| |
99%
| file
| data
| default
| |
74%
| TrID
| Macintosh plain text (MacBinary)
| default
| |
25%
| TrID
| MacBinary 2
| default (weak)
| |
100%
| siegfried
| fmt/1762 MacBinary (II)
| default
| |
100%
| lsar
| MacBinary
| default
|
|
id metadata |
---|
key | value |
---|
macFileType | [TEXT] |
macFileCreator | [MPS ] |
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0a 43 6f 6d 6d 65 6e | 74 73 2e 63 00 00 00 00 |..Commen|ts.c....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 77 38 00 | 00 02 34 ac 75 03 a2 ac |.....w8.|..4.u...|
|00000060| 75 03 a2 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |u.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 0c 42 00 00 |........|.....B..|
|00000080| 2f 2a 20 43 6f 6d 6d 65 | 6e 74 73 2e 63 3a 20 43 |/* Comme|nts.c: C|
|00000090| 6f 6d 6d 65 6e 74 20 68 | 61 6e 64 6c 69 6e 67 20 |omment h|andling |
|000000a0| 66 6f 72 20 50 72 6f 6a | 65 63 74 44 72 61 67 0d |for Proj|ectDrag.|
|000000b0| 20 2a 0d 20 2a 20 41 20 | 73 65 74 20 6f 66 20 61 | *. * A |set of a|
|000000c0| 70 70 6c 65 74 73 20 66 | 6f 72 20 64 72 61 67 20 |pplets f|or drag |
|000000d0| 61 6e 64 20 64 72 6f 70 | 20 73 6f 75 72 63 65 20 |and drop| source |
|000000e0| 63 6f 6e 74 72 6f 6c 20 | 62 79 20 54 69 6d 20 4d |control |by Tim M|
|000000f0| 61 72 6f 6e 65 79 2e 0d | 20 2a 20 53 65 65 20 64 |aroney..| * See d|
|00000100| 65 76 65 6c 6f 70 2c 20 | 69 73 73 75 65 20 32 33 |evelop, |issue 23|
|00000110| 20 66 6f 72 20 64 65 74 | 61 69 6c 73 2e 0d 20 2a | for det|ails.. *|
|00000120| 0d 20 2a 20 42 75 69 6c | 74 20 6f 6e 20 44 72 6f |. * Buil|t on Dro|
|00000130| 70 53 68 65 6c 6c 20 62 | 79 20 4c 65 6f 6e 61 72 |pShell b|y Leonar|
|00000140| 64 20 52 6f 73 65 6e 74 | 68 6f 6c 2c 20 53 74 65 |d Rosent|hol, Ste|
|00000150| 70 68 61 6e 20 53 6f 6d | 6f 67 79 69 2c 20 61 6e |phan Som|ogyi, an|
|00000160| 64 20 4d 61 72 73 68 61 | 6c 6c 20 43 6c 6f 77 2c |d Marsha|ll Clow,|
|00000170| 0d 20 2a 20 61 6e 64 20 | 75 73 69 6e 67 20 74 68 |. * and |using th|
|00000180| 65 20 4d 6f 72 65 46 69 | 6c 65 73 20 75 74 69 6c |e MoreFi|les util|
|00000190| 69 74 69 65 73 20 62 79 | 20 4a 69 6d 20 4c 75 74 |ities by| Jim Lut|
|000001a0| 68 65 72 2e 0d 20 2a 0d | 20 2a 20 54 68 69 73 20 |her.. *.| * This |
|000001b0| 73 6f 66 74 77 61 72 65 | 20 69 73 20 66 72 65 65 |software| is free|
|000001c0| 2c 20 62 75 74 20 64 6f | 6e 27 74 20 6d 6f 64 69 |, but do|n't modi|
|000001d0| 66 79 20 61 6e 64 20 72 | 65 64 69 73 74 72 69 62 |fy and r|edistrib|
|000001e0| 75 74 65 20 69 74 20 77 | 69 74 68 6f 75 74 0d 20 |ute it w|ithout. |
|000001f0| 2a 20 63 68 61 6e 67 69 | 6e 67 20 74 68 65 20 73 |* changi|ng the s|
|00000200| 74 61 74 75 73 20 77 69 | 6e 64 6f 77 20 74 6f 20 |tatus wi|ndow to |
|00000210| 69 6e 64 69 63 61 74 65 | 20 79 6f 75 72 20 6e 61 |indicate| your na|
|00000220| 6d 65 20 61 6e 64 20 79 | 6f 75 72 20 63 68 61 6e |me and y|our chan|
|00000230| 67 65 73 21 0d 20 2a 2f | 0d 0d 0d 23 69 6e 63 6c |ges!. */|...#incl|
|00000240| 75 64 65 20 3c 54 79 70 | 65 73 2e 68 3e 0d 23 69 |ude <Typ|es.h>.#i|
|00000250| 6e 63 6c 75 64 65 20 3c | 52 65 73 6f 75 72 63 65 |nclude <|Resource|
|00000260| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 20 3c 44 |s.h>.#in|clude <D|
|00000270| 69 61 6c 6f 67 73 2e 68 | 3e 0d 23 69 6e 63 6c 75 |ialogs.h|>.#inclu|
|00000280| 64 65 20 3c 54 6f 6f 6c | 55 74 69 6c 73 2e 68 3e |de <Tool|Utils.h>|
|00000290| 0d 0d 23 69 6e 63 6c 75 | 64 65 20 22 50 44 55 74 |..#inclu|de "PDUt|
|000002a0| 69 6c 69 74 69 65 73 2e | 68 22 0d 23 69 6e 63 6c |ilities.|h".#incl|
|000002b0| 75 64 65 20 22 50 44 44 | 69 61 6c 6f 67 73 2e 68 |ude "PDD|ialogs.h|
|000002c0| 22 0d 23 69 6e 63 6c 75 | 64 65 20 22 43 6f 6d 6d |".#inclu|de "Comm|
|000002d0| 65 6e 74 73 2e 68 22 0d | 23 69 6e 63 6c 75 64 65 |ents.h".|#include|
|000002e0| 20 22 54 61 73 6b 73 41 | 6e 64 45 72 72 6f 72 73 | "TasksA|ndErrors|
|000002f0| 2e 68 22 0d 0d 0d 23 64 | 65 66 69 6e 65 20 6b 43 |.h"...#d|efine kC|
|00000300| 68 61 6e 67 65 43 6f 6d | 6d 65 6e 74 44 69 61 6c |hangeCom|mentDial|
|00000310| 6f 67 20 32 30 34 0d 23 | 64 65 66 69 6e 65 20 6b |og 204.#|define k|
|00000320| 43 6f 6d 6d 65 6e 74 49 | 74 65 6d 20 35 0d 0d 0d |CommentI|tem 5...|
|00000330| 74 79 70 65 64 65 66 20 | 73 74 72 75 63 74 0d 7b |typedef |struct.{|
|00000340| 0d 09 53 74 72 69 6e 67 | 50 74 72 20 65 78 74 65 |..String|Ptr exte|
|00000350| 6e 73 69 6f 6e 3b 0d 09 | 53 74 72 69 6e 67 50 74 |nsion;..|StringPt|
|00000360| 72 20 63 6f 6d 6d 65 6e | 74 53 74 61 72 74 3b 0d |r commen|tStart;.|
|00000370| 09 53 74 72 69 6e 67 50 | 74 72 20 6c 69 6e 65 53 |.StringP|tr lineS|
|00000380| 74 61 72 74 3b 0d 09 53 | 74 72 69 6e 67 50 74 72 |tart;..S|tringPtr|
|00000390| 20 6c 69 6e 65 45 6e 64 | 3b 0d 09 53 74 72 69 6e | lineEnd|;..Strin|
|000003a0| 67 50 74 72 20 62 6c 61 | 6e 6b 4c 69 6e 65 3b 0d |gPtr bla|nkLine;.|
|000003b0| 09 53 74 72 69 6e 67 50 | 74 72 20 63 6f 6d 6d 65 |.StringP|tr comme|
|000003c0| 6e 74 45 6e 64 3b 0d 7d | 20 43 6f 6d 6d 65 6e 74 |ntEnd;.}| Comment|
|000003d0| 46 6f 72 6d 61 74 3b 0d | 0d 0d 2f 2a 20 58 58 58 |Format;.|../* XXX|
|000003e0| 20 79 65 61 68 2c 20 79 | 65 61 68 2c 20 74 68 69 | yeah, y|eah, thi|
|000003f0| 73 20 74 61 62 6c 65 20 | 73 68 6f 75 6c 64 20 62 |s table |should b|
|00000400| 65 20 73 74 6f 72 65 64 | 20 69 6e 20 61 20 75 73 |e stored| in a us|
|00000410| 65 72 2d 65 64 69 74 61 | 62 6c 65 20 66 69 6c 65 |er-edita|ble file|
|00000420| 20 2d 2d 20 6d 61 79 62 | 65 20 69 6e 20 31 2e 32 | -- mayb|e in 1.2|
|00000430| 20 2a 2f 0d 0d 23 64 65 | 66 69 6e 65 20 6b 4e 75 | */..#de|fine kNu|
|00000440| 6d 43 6f 6d 6d 65 6e 74 | 46 6f 72 6d 61 74 73 20 |mComment|Formats |
|00000450| 31 32 0d 0d 43 6f 6d 6d | 65 6e 74 46 6f 72 6d 61 |12..Comm|entForma|
|00000460| 74 20 70 43 6f 6d 6d 65 | 6e 74 46 6f 72 6d 61 74 |t pComme|ntFormat|
|00000470| 73 5b 6b 4e 75 6d 43 6f | 6d 6d 65 6e 74 46 6f 72 |s[kNumCo|mmentFor|
|00000480| 6d 61 74 73 5d 20 3d 0d | 7b 0d 09 7b 20 22 5c 70 |mats] =.|{..{ "\p|
|00000490| 2e 63 22 2c 20 22 5c 70 | 2f 2a 5c 6e 22 2c 20 22 |.c", "\p|/*\n", "|
|000004a0| 5c 70 22 2c 20 22 5c 70 | 22 2c 20 22 5c 70 22 2c |\p", "\p|", "\p",|
|000004b0| 20 22 5c 70 2a 2f 5c 6e | 22 20 7d 2c 0d 09 7b 20 | "\p*/\n|" },..{ |
|000004c0| 22 5c 70 2e 68 22 2c 20 | 22 5c 70 2f 2a 5c 6e 22 |"\p.h", |"\p/*\n"|
|000004d0| 2c 20 22 5c 70 22 2c 20 | 22 5c 70 22 2c 20 22 5c |, "\p", |"\p", "\|
|000004e0| 70 22 2c 20 22 5c 70 2a | 2f 5c 6e 22 20 7d 2c 0d |p", "\p*|/\n" },.|
|000004f0| 09 7b 20 22 5c 70 2e 63 | 70 22 2c 20 22 5c 70 2f |.{ "\p.c|p", "\p/|
|00000500| 2a 5c 6e 22 2c 20 22 5c | 70 22 2c 20 22 5c 70 22 |*\n", "\|p", "\p"|
|00000510| 2c 20 22 5c 70 22 2c 20 | 22 5c 70 2a 2f 5c 6e 22 |, "\p", |"\p*/\n"|
|00000520| 20 7d 2c 0d 09 7b 20 22 | 5c 70 2e 63 63 22 2c 20 | },..{ "|\p.cc", |
|00000530| 22 5c 70 2f 2a 5c 6e 22 | 2c 20 22 5c 70 22 2c 20 |"\p/*\n"|, "\p", |
|00000540| 22 5c 70 22 2c 20 22 5c | 70 22 2c 20 22 5c 70 2a |"\p", "\|p", "\p*|
|00000550| 2f 5c 6e 22 20 7d 2c 0d | 09 7b 20 22 5c 70 2e 63 |/\n" },.|.{ "\p.c|
|00000560| 70 70 22 2c 20 22 5c 70 | 2f 2a 5c 6e 22 2c 20 22 |pp", "\p|/*\n", "|
|00000570| 5c 70 22 2c 20 22 5c 70 | 22 2c 20 22 5c 70 22 2c |\p", "\p|", "\p",|
|00000580| 20 22 5c 70 2a 2f 5c 6e | 22 20 7d 2c 0d 09 7b 20 | "\p*/\n|" },..{ |
|00000590| 22 5c 70 2e 70 63 68 22 | 2c 20 22 5c 70 2f 2a 5c |"\p.pch"|, "\p/*\|
|000005a0| 6e 22 2c 20 22 5c 70 22 | 2c 20 22 5c 70 22 2c 20 |n", "\p"|, "\p", |
|000005b0| 22 5c 70 22 2c 20 22 5c | 70 2a 2f 5c 6e 22 20 7d |"\p", "\|p*/\n" }|
|000005c0| 2c 0d 09 7b 20 22 5c 70 | 2e 69 64 6c 22 2c 20 22 |,..{ "\p|.idl", "|
|000005d0| 5c 70 2f 2a 5c 6e 22 2c | 20 22 5c 70 22 2c 20 22 |\p/*\n",| "\p", "|
|000005e0| 5c 70 22 2c 20 22 5c 70 | 22 2c 20 22 5c 70 2a 2f |\p", "\p|", "\p*/|
|000005f0| 5c 6e 22 20 7d 2c 0d 09 | 7b 20 22 5c 70 2e 72 22 |\n" },..|{ "\p.r"|
|00000600| 2c 20 22 5c 70 2f 2a 5c | 6e 22 2c 20 22 5c 70 22 |, "\p/*\|n", "\p"|
|00000610| 2c 20 22 5c 70 22 2c 20 | 22 5c 70 22 2c 20 22 5c |, "\p", |"\p", "\|
|00000620| 70 2a 2f 5c 6e 22 20 7d | 2c 0d 09 7b 20 22 5c 70 |p*/\n" }|,..{ "\p|
|00000630| 2e 70 22 2c 20 22 5c 70 | 28 2a 5c 6e 22 2c 20 22 |.p", "\p|(*\n", "|
|00000640| 5c 70 22 2c 20 22 5c 70 | 22 2c 20 22 5c 70 22 2c |\p", "\p|", "\p",|
|00000650| 20 22 5c 70 2a 29 5c 6e | 22 20 7d 2c 0d 09 7b 20 | "\p*)\n|" },..{ |
|00000660| 22 5c 70 2e 61 22 2c 20 | 22 5c 70 22 2c 20 22 5c |"\p.a", |"\p", "\|
|00000670| 70 2a 22 2c 20 22 5c 70 | 22 2c 20 22 5c 70 2a 22 |p*", "\p|", "\p*"|
|00000680| 2c 20 22 5c 70 2a 5c 6e | 22 20 7d 2c 0d 09 7b 20 |, "\p*\n|" },..{ |
|00000690| 22 5c 70 2e 73 22 2c 20 | 22 5c 70 22 2c 20 22 5c |"\p.s", |"\p", "\|
|000006a0| 70 2a 22 2c 20 22 5c 70 | 22 2c 20 22 5c 70 2a 22 |p*", "\p|", "\p*"|
|000006b0| 2c 20 22 5c 70 2a 5c 6e | 22 20 7d 2c 0d 09 7b 20 |, "\p*\n|" },..{ |
|000006c0| 22 5c 70 22 2c 20 22 5c | 70 23 5c 6e 22 2c 20 22 |"\p", "\|p#\n", "|
|000006d0| 5c 70 23 22 2c 20 22 5c | 70 22 2c 20 22 5c 70 23 |\p#", "\|p", "\p#|
|000006e0| 22 2c 20 22 5c 70 23 5c | 6e 22 20 7d 20 2f 2a 20 |", "\p#\|n" } /* |
|000006f0| 74 68 69 73 20 6c 69 6e | 65 20 6d 75 73 74 20 62 |this lin|e must b|
|00000700| 65 20 6c 61 73 74 20 2a | 2f 0d 7d 3b 0d 0d 0d 70 |e last *|/.};...p|
|00000710| 61 73 63 61 6c 20 42 6f | 6f 6c 65 61 6e 20 54 68 |ascal Bo|olean Th|
|00000720| 65 46 69 6c 74 65 72 50 | 72 6f 63 28 44 69 61 6c |eFilterP|roc(Dial|
|00000730| 6f 67 50 74 72 20 74 68 | 65 44 69 61 6c 6f 67 2c |ogPtr th|eDialog,|
|00000740| 45 76 65 6e 74 52 65 63 | 6f 72 64 20 2a 65 76 2c |EventRec|ord *ev,|
|00000750| 73 68 6f 72 74 20 2a 69 | 74 65 6d 48 69 74 29 0d |short *i|temHit).|
|00000760| 7b 0d 09 72 65 74 75 72 | 6e 20 53 74 64 46 69 6c |{..retur|n StdFil|
|00000770| 74 65 72 50 72 6f 63 28 | 74 68 65 44 69 61 6c 6f |terProc(|theDialo|
|00000780| 67 2c 20 65 76 2c 20 69 | 74 65 6d 48 69 74 29 3b |g, ev, i|temHit);|
|00000790| 0d 7d 0d 0d 0d 76 6f 69 | 64 20 53 61 76 65 50 72 |.}...voi|d SavePr|
|000007a0| 65 76 69 6f 75 73 43 6f | 6d 6d 65 6e 74 28 53 74 |eviousCo|mment(St|
|000007b0| 72 69 6e 67 50 74 72 20 | 63 6f 6d 6d 65 6e 74 29 |ringPtr |comment)|
|000007c0| 0d 7b 0d 09 4f 53 45 72 | 72 20 65 72 72 3b 0d 09 |.{..OSEr|r err;..|
|000007d0| 46 53 53 70 65 63 20 66 | 69 6c 65 3b 0d 09 48 61 |FSSpec f|ile;..Ha|
|000007e0| 6e 64 6c 65 20 66 69 6c | 65 44 61 74 61 20 3d 20 |ndle fil|eData = |
|000007f0| 4e 55 4c 4c 3b 0d 09 73 | 68 6f 72 74 20 72 65 66 |NULL;..s|hort ref|
|00000800| 4e 75 6d 20 3d 20 2d 31 | 3b 0d 09 0d 09 2f 2a 20 |Num = -1|;..../* |
|00000810| 66 69 6e 64 20 74 68 65 | 20 70 72 65 66 65 72 65 |find the| prefere|
|00000820| 6e 63 65 73 20 66 6f 6c | 64 65 72 20 2a 2f 0d 09 |nces fol|der */..|
|00000830| 65 72 72 20 3d 20 46 69 | 6e 64 50 72 65 66 65 72 |err = Fi|ndPrefer|
|00000840| 65 6e 63 65 73 46 6f 6c | 64 65 72 28 26 66 69 6c |encesFol|der(&fil|
|00000850| 65 2e 76 52 65 66 4e 75 | 6d 2c 20 26 66 69 6c 65 |e.vRefNu|m, &file|
|00000860| 2e 70 61 72 49 44 29 3b | 0d 09 69 66 20 28 65 72 |.parID);|..if (er|
|00000870| 72 20 21 3d 20 6e 6f 45 | 72 72 29 20 67 6f 74 6f |r != noE|rr) goto|
|00000880| 20 45 72 72 6f 72 45 78 | 69 74 3b 0d 09 0d 09 2f | ErrorEx|it;..../|
|00000890| 2a 20 73 65 74 20 74 68 | 65 20 50 72 65 76 69 6f |* set th|e Previo|
|000008a0| 75 73 20 43 6f 6d 6d 65 | 6e 74 20 66 69 6c 65 20 |us Comme|nt file |
|000008b0| 64 61 74 61 20 2a 2f 0d | 09 47 65 74 49 6e 64 53 |data */.|.GetIndS|
|000008c0| 74 72 69 6e 67 28 66 69 | 6c 65 2e 6e 61 6d 65 2c |tring(fi|le.name,|
|000008d0| 20 6b 50 72 6f 6a 65 63 | 74 44 72 61 67 53 74 72 | kProjec|tDragStr|
|000008e0| 69 6e 67 73 2c 20 6b 50 | 72 65 76 69 6f 75 73 43 |ings, kP|reviousC|
|000008f0| 6f 6d 6d 65 6e 74 46 69 | 6c 65 4e 61 6d 65 29 3b |ommentFi|leName);|
|00000900| 0d 09 65 72 72 20 3d 20 | 47 65 74 46 69 6c 65 44 |..err = |GetFileD|
|00000910| 61 74 61 28 26 66 69 6c | 65 2c 20 26 66 69 6c 65 |ata(&fil|e, &file|
|00000920| 44 61 74 61 2c 20 26 72 | 65 66 4e 75 6d 29 3b 0d |Data, &r|efNum);.|
|00000930| 09 69 66 20 28 65 72 72 | 20 3d 3d 20 66 6e 66 45 |.if (err| == fnfE|
|00000940| 72 72 29 0d 09 7b 0d 09 | 09 2f 2a 20 63 72 65 61 |rr)..{..|./* crea|
|00000950| 74 65 20 61 6e 64 20 6f | 70 65 6e 20 74 68 65 20 |te and o|pen the |
|00000960| 66 69 6c 65 20 2a 2f 0d | 09 09 65 72 72 20 3d 20 |file */.|..err = |
|00000970| 46 53 70 43 72 65 61 74 | 65 28 26 66 69 6c 65 2c |FSpCreat|e(&file,|
|00000980| 20 27 4d 50 53 20 27 2c | 20 27 54 45 58 54 27 2c | 'MPS ',| 'TEXT',|
|00000990| 20 73 6d 53 79 73 74 65 | 6d 53 63 72 69 70 74 29 | smSyste|mScript)|
|000009a0| 3b 0d 09 09 69 66 20 28 | 65 72 72 20 21 3d 20 6e |;...if (|err != n|
|000009b0| 6f 45 72 72 29 20 67 6f | 74 6f 20 45 72 72 6f 72 |oErr) go|to Error|
|000009c0| 45 78 69 74 3b 0d 09 09 | 65 72 72 20 3d 20 46 53 |Exit;...|err = FS|
|000009d0| 70 4f 70 65 6e 44 46 28 | 26 66 69 6c 65 2c 20 66 |pOpenDF(|&file, f|
|000009e0| 73 52 64 57 72 50 65 72 | 6d 2c 20 26 72 65 66 4e |sRdWrPer|m, &refN|
|000009f0| 75 6d 29 3b 0d 09 09 69 | 66 20 28 65 72 72 20 21 |um);...i|f (err !|
|00000a00| 3d 20 6e 6f 45 72 72 29 | 20 67 6f 74 6f 20 45 72 |= noErr)| goto Er|
|00000a10| 72 6f 72 45 78 69 74 3b | 0d 09 09 66 69 6c 65 44 |rorExit;|...fileD|
|00000a20| 61 74 61 20 3d 20 54 65 | 6d 70 4e 65 77 48 61 6e |ata = Te|mpNewHan|
|00000a30| 64 6c 65 28 30 2c 20 26 | 65 72 72 29 3b 0d 09 7d |dle(0, &|err);..}|
|00000a40| 0d 09 69 66 20 28 65 72 | 72 20 21 3d 20 6e 6f 45 |..if (er|r != noE|
|00000a50| 72 72 29 20 67 6f 74 6f | 20 45 72 72 6f 72 45 78 |rr) goto| ErrorEx|
|00000a60| 69 74 3b 0d 09 53 65 74 | 48 61 6e 64 6c 65 53 69 |it;..Set|HandleSi|
|00000a70| 7a 65 28 66 69 6c 65 44 | 61 74 61 2c 20 30 29 3b |ze(fileD|ata, 0);|
|00000a80| 0d 09 65 72 72 20 3d 20 | 50 74 72 41 6e 64 48 61 |..err = |PtrAndHa|
|00000a90| 6e 64 28 63 6f 6d 6d 65 | 6e 74 20 2b 20 31 2c 20 |nd(comme|nt + 1, |
|00000aa0| 66 69 6c 65 44 61 74 61 | 2c 20 63 6f 6d 6d 65 6e |fileData|, commen|
|00000ab0| 74 5b 30 5d 29 3b 0d 09 | 69 66 20 28 65 72 72 20 |t[0]);..|if (err |
|00000ac0| 21 3d 20 6e 6f 45 72 72 | 29 20 67 6f 74 6f 20 45 |!= noErr|) goto E|
|00000ad0| 72 72 6f 72 45 78 69 74 | 3b 0d 09 65 72 72 20 3d |rrorExit|;..err =|
|00000ae0| 20 57 72 69 74 65 46 69 | 6c 65 57 69 74 68 48 65 | WriteFi|leWithHe|
|00000af0| 61 64 65 72 28 72 65 66 | 4e 75 6d 2c 20 66 69 6c |ader(ref|Num, fil|
|00000b00| 65 44 61 74 61 2c 20 30 | 2c 20 4e 55 4c 4c 29 3b |eData, 0|, NULL);|
|00000b10| 0d 09 69 66 20 28 65 72 | 72 20 21 3d 20 6e 6f 45 |..if (er|r != noE|
|00000b20| 72 72 29 20 67 6f 74 6f | 20 45 72 72 6f 72 45 78 |rr) goto| ErrorEx|
|00000b30| 69 74 3b 0d 09 0d 09 2f | 2a 20 63 6c 65 61 6e 20 |it;..../|* clean |
|00000b40| 75 70 20 61 6e 64 20 67 | 6f 20 2a 2f 0d 09 44 69 |up and g|o */..Di|
|00000b50| 73 70 6f 73 65 48 61 6e | 64 6c 65 28 66 69 6c 65 |sposeHan|dle(file|
|00000b60| 44 61 74 61 29 3b 0d 09 | 46 53 43 6c 6f 73 65 28 |Data);..|FSClose(|
|00000b70| 72 65 66 4e 75 6d 29 3b | 0d 09 72 65 74 75 72 6e |refNum);|..return|
|00000b80| 3b 0d 0d 45 72 72 6f 72 | 45 78 69 74 3a 0d 09 69 |;..Error|Exit:..i|
|00000b90| 66 20 28 66 69 6c 65 44 | 61 74 61 20 21 3d 20 4e |f (fileD|ata != N|
|00000ba0| 55 4c 4c 29 0d 09 09 44 | 69 73 70 6f 73 65 48 61 |ULL)...D|isposeHa|
|00000bb0| 6e 64 6c 65 28 66 69 6c | 65 44 61 74 61 29 3b 0d |ndle(fil|eData);.|
|00000bc0| 09 69 66 20 28 72 65 66 | 4e 75 6d 20 21 3d 20 2d |.if (ref|Num != -|
|00000bd0| 31 29 0d 09 09 46 53 43 | 6c 6f 73 65 28 72 65 66 |1)...FSC|lose(ref|
|00000be0| 4e 75 6d 29 3b 0d 7d 0d | 0d 0d 76 6f 69 64 20 46 |Num);.}.|..void F|
|00000bf0| 65 74 63 68 50 72 65 76 | 69 6f 75 73 43 6f 6d 6d |etchPrev|iousComm|
|00000c00| 65 6e 74 28 53 74 72 69 | 6e 67 50 74 72 20 63 6f |ent(Stri|ngPtr co|
|00000c10| 6d 6d 65 6e 74 29 0d 7b | 0d 09 4f 53 45 72 72 20 |mment).{|..OSErr |
|00000c20| 65 72 72 3b 0d 09 46 53 | 53 70 65 63 20 66 69 6c |err;..FS|Spec fil|
|00000c30| 65 3b 0d 09 48 61 6e 64 | 6c 65 20 66 69 6c 65 44 |e;..Hand|le fileD|
|00000c40| 61 74 61 3b 0d 09 73 68 | 6f 72 74 20 72 65 66 4e |ata;..sh|ort refN|
|00000c50| 75 6d 3b 0d 09 0d 09 63 | 6f 6d 6d 65 6e 74 5b 30 |um;....c|omment[0|
|00000c60| 5d 20 3d 20 30 3b 0d 09 | 0d 09 2f 2a 20 66 69 6e |] = 0;..|../* fin|
|00000c70| 64 20 74 68 65 20 70 72 | 65 66 65 72 65 6e 63 65 |d the pr|eference|
|00000c80| 73 20 66 6f 6c 64 65 72 | 20 2a 2f 0d 09 65 72 72 |s folder| */..err|
|00000c90| 20 3d 20 46 69 6e 64 50 | 72 65 66 65 72 65 6e 63 | = FindP|referenc|
|00000ca0| 65 73 46 6f 6c 64 65 72 | 28 26 66 69 6c 65 2e 76 |esFolder|(&file.v|
|00000cb0| 52 65 66 4e 75 6d 2c 20 | 26 66 69 6c 65 2e 70 61 |RefNum, |&file.pa|
|00000cc0| 72 49 44 29 3b 0d 09 69 | 66 20 28 65 72 72 20 21 |rID);..i|f (err !|
|00000cd0| 3d 20 6e 6f 45 72 72 29 | 20 72 65 74 75 72 6e 3b |= noErr)| return;|
|00000ce0| 0d 09 0d 09 2f 2a 20 67 | 65 74 20 74 68 65 20 50 |..../* g|et the P|
|00000cf0| 72 65 76 69 6f 75 73 20 | 43 6f 6d 6d 65 6e 74 20 |revious |Comment |
|00000d00| 66 69 6c 65 20 64 61 74 | 61 20 2a 2f 0d 09 47 65 |file dat|a */..Ge|
|00000d10| 74 49 6e 64 53 74 72 69 | 6e 67 28 66 69 6c 65 2e |tIndStri|ng(file.|
|00000d20| 6e 61 6d 65 2c 20 6b 50 | 72 6f 6a 65 63 74 44 72 |name, kP|rojectDr|
|00000d30| 61 67 53 74 72 69 6e 67 | 73 2c 20 6b 50 72 65 76 |agString|s, kPrev|
|00000d40| 69 6f 75 73 43 6f 6d 6d | 65 6e 74 46 69 6c 65 4e |iousComm|entFileN|
|00000d50| 61 6d 65 29 3b 0d 09 65 | 72 72 20 3d 20 47 65 74 |ame);..e|rr = Get|
|00000d60| 46 69 6c 65 44 61 74 61 | 28 26 66 69 6c 65 2c 20 |FileData|(&file, |
|00000d70| 26 66 69 6c 65 44 61 74 | 61 2c 20 26 72 65 66 4e |&fileDat|a, &refN|
|00000d80| 75 6d 29 3b 0d 09 69 66 | 20 28 65 72 72 20 21 3d |um);..if| (err !=|
|00000d90| 20 6e 6f 45 72 72 29 20 | 72 65 74 75 72 6e 3b 0d | noErr) |return;.|
|00000da0| 09 46 53 43 6c 6f 73 65 | 28 72 65 66 4e 75 6d 29 |.FSClose|(refNum)|
|00000db0| 3b 0d 09 63 6f 6d 6d 65 | 6e 74 5b 30 5d 20 3d 20 |;..comme|nt[0] = |
|00000dc0| 47 65 74 48 61 6e 64 6c | 65 53 69 7a 65 28 66 69 |GetHandl|eSize(fi|
|00000dd0| 6c 65 44 61 74 61 29 3b | 0d 09 42 6c 6f 63 6b 4d |leData);|..BlockM|
|00000de0| 6f 76 65 44 61 74 61 28 | 2a 66 69 6c 65 44 61 74 |oveData(|*fileDat|
|00000df0| 61 2c 20 63 6f 6d 6d 65 | 6e 74 20 2b 20 31 2c 20 |a, comme|nt + 1, |
|00000e00| 63 6f 6d 6d 65 6e 74 5b | 30 5d 29 3b 0d 09 44 69 |comment[|0]);..Di|
|00000e10| 73 70 6f 73 65 48 61 6e | 64 6c 65 28 66 69 6c 65 |sposeHan|dle(file|
|00000e20| 44 61 74 61 29 3b 0d 7d | 0d 0d 0d 42 6f 6f 6c 65 |Data);.}|...Boole|
|00000e30| 61 6e 20 47 65 74 43 68 | 61 6e 67 65 43 6f 6d 6d |an GetCh|angeComm|
|00000e40| 65 6e 74 28 42 6f 6f 6c | 65 61 6e 20 69 6e 2c 20 |ent(Bool|ean in, |
|00000e50| 43 6f 6e 73 74 53 74 72 | 32 35 35 50 61 72 61 6d |ConstStr|255Param|
|00000e60| 20 66 69 6c 65 4e 61 6d | 65 2c 20 53 74 72 32 35 | fileNam|e, Str25|
|00000e70| 35 20 63 6f 6d 6d 65 6e | 74 29 0d 7b 0d 09 44 69 |5 commen|t).{..Di|
|00000e80| 61 6c 6f 67 50 74 72 20 | 64 69 61 6c 6f 67 3b 0d |alogPtr |dialog;.|
|00000e90| 09 42 6f 6f 6c 65 61 6e | 20 64 6f 6e 65 20 3d 20 |.Boolean| done = |
|00000ea0| 66 61 6c 73 65 3b 0d 09 | 42 6f 6f 6c 65 61 6e 20 |false;..|Boolean |
|00000eb0| 72 65 73 75 6c 74 20 3d | 20 66 61 6c 73 65 3b 0d |result =| false;.|
|00000ec0| 09 4f 53 45 72 72 20 65 | 72 72 20 3d 20 6e 6f 45 |.OSErr e|rr = noE|
|00000ed0| 72 72 3b 0d 09 53 74 72 | 32 35 35 20 77 68 61 74 |rr;..Str|255 what|
|00000ee0| 3b 0d 09 53 74 72 32 35 | 35 20 73 3b 0d 09 52 65 |;..Str25|5 s;..Re|
|00000ef0| 63 74 20 72 3b 0d 09 48 | 61 6e 64 6c 65 20 68 3b |ct r;..H|andle h;|
|00000f00| 0d 09 73 68 6f 72 74 20 | 74 79 70 65 3b 0d 09 0d |..short |type;...|
|00000f10| 09 47 65 74 49 6e 64 53 | 74 72 69 6e 67 28 73 2c |.GetIndS|tring(s,|
|00000f20| 20 6b 50 72 6f 6a 65 63 | 74 44 72 61 67 53 74 72 | kProjec|tDragStr|
|00000f30| 69 6e 67 73 2c 20 6b 45 | 78 70 6c 61 69 6e 43 68 |ings, kE|xplainCh|
|00000f40| 61 6e 67 65 29 3b 0d 09 | 69 66 20 28 69 6e 29 0d |ange);..|if (in).|
|00000f50| 09 09 47 65 74 49 6e 64 | 53 74 72 69 6e 67 28 77 |..GetInd|String(w|
|00000f60| 68 61 74 2c 20 6b 50 72 | 6f 6a 65 63 74 44 72 61 |hat, kPr|ojectDra|
|00000f70| 67 53 74 72 69 6e 67 73 | 2c 20 6b 57 68 61 74 59 |gStrings|, kWhatY|
|00000f80| 6f 75 43 68 61 6e 67 65 | 64 49 6e 29 3b 0d 09 65 |ouChange|dIn);..e|
|00000f90| 6c 73 65 0d 09 09 47 65 | 74 49 6e 64 53 74 72 69 |lse...Ge|tIndStri|
|00000fa0| 6e 67 28 77 68 61 74 2c | 20 6b 50 72 6f 6a 65 63 |ng(what,| kProjec|
|00000fb0| 74 44 72 61 67 53 74 72 | 69 6e 67 73 2c 20 6b 57 |tDragStr|ings, kW|
|00000fc0| 68 61 74 59 6f 75 57 69 | 6c 6c 44 6f 57 69 74 68 |hatYouWi|llDoWith|
|00000fd0| 29 3b 0d 09 65 72 72 20 | 3d 20 50 74 72 54 6f 48 |);..err |= PtrToH|
|00000fe0| 61 6e 64 28 73 20 2b 20 | 31 2c 20 26 68 2c 20 73 |and(s + |1, &h, s|
|00000ff0| 5b 30 5d 29 3b 0d 09 65 | 72 72 20 3d 20 52 65 70 |[0]);..e|rr = Rep|
|00001000| 6c 61 63 65 53 74 72 69 | 6e 67 28 68 2c 20 22 5c |laceStri|ng(h, "\|
|00001010| 70 3c 31 3e 22 2c 20 77 | 68 61 74 29 3b 0d 09 65 |p<1>", w|hat);..e|
|00001020| 72 72 20 3d 20 52 65 70 | 6c 61 63 65 53 74 72 69 |rr = Rep|laceStri|
|00001030| 6e 67 28 68 2c 20 22 5c | 70 3c 32 3e 22 2c 20 66 |ng(h, "\|p<2>", f|
|00001040| 69 6c 65 4e 61 6d 65 29 | 3b 0d 09 73 5b 30 5d 20 |ileName)|;..s[0] |
|00001050| 3d 20 47 65 74 48 61 6e | 64 6c 65 53 69 7a 65 28 |= GetHan|dleSize(|
|00001060| 68 29 3b 0d 09 42 6c 6f | 63 6b 4d 6f 76 65 44 61 |h);..Blo|ckMoveDa|
|00001070| 74 61 28 2a 68 2c 20 73 | 20 2b 20 31 2c 20 73 5b |ta(*h, s| + 1, s[|
|00001080| 30 5d 29 3b 0d 09 44 69 | 73 70 6f 73 65 48 61 6e |0]);..Di|sposeHan|
|00001090| 64 6c 65 28 68 29 3b 0d | 09 50 61 72 61 6d 54 65 |dle(h);.|.ParamTe|
|000010a0| 78 74 28 73 2c 20 4e 55 | 4c 4c 2c 20 4e 55 4c 4c |xt(s, NU|LL, NULL|
|000010b0| 2c 20 4e 55 4c 4c 29 3b | 0d 09 0d 09 64 69 61 6c |, NULL);|....dial|
|000010c0| 6f 67 20 3d 20 47 65 74 | 4e 65 77 44 69 61 6c 6f |og = Get|NewDialo|
|000010d0| 67 28 6b 43 68 61 6e 67 | 65 43 6f 6d 6d 65 6e 74 |g(kChang|eComment|
|000010e0| 44 69 61 6c 6f 67 2c 20 | 4e 55 4c 4c 2c 20 28 57 |Dialog, |NULL, (W|
|000010f0| 69 6e 64 6f 77 50 74 72 | 29 2d 31 29 3b 0d 09 69 |indowPtr|)-1);..i|
|00001100| 66 20 28 64 69 61 6c 6f | 67 20 3d 3d 20 4e 55 4c |f (dialo|g == NUL|
|00001110| 4c 29 20 72 65 74 75 72 | 6e 20 66 61 6c 73 65 3b |L) retur|n false;|
|00001120| 0d 09 69 66 20 28 63 6f | 6d 6d 65 6e 74 5b 30 5d |..if (co|mment[0]|
|00001130| 20 3d 3d 20 30 29 20 46 | 65 74 63 68 50 72 65 76 | == 0) F|etchPrev|
|00001140| 69 6f 75 73 43 6f 6d 6d | 65 6e 74 28 63 6f 6d 6d |iousComm|ent(comm|
|00001150| 65 6e 74 29 3b 0d 09 47 | 65 74 44 69 61 6c 6f 67 |ent);..G|etDialog|
|00001160| 49 74 65 6d 28 64 69 61 | 6c 6f 67 2c 20 6b 43 6f |Item(dia|log, kCo|
|00001170| 6d 6d 65 6e 74 49 74 65 | 6d 2c 20 26 74 79 70 65 |mmentIte|m, &type|
|00001180| 2c 20 26 68 2c 20 26 72 | 29 3b 0d 09 53 65 74 44 |, &h, &r|);..SetD|
|00001190| 69 61 6c 6f 67 49 74 65 | 6d 54 65 78 74 28 68 2c |ialogIte|mText(h,|
|000011a0| 20 63 6f 6d 6d 65 6e 74 | 29 3b 0d 09 53 65 6c 65 | comment|);..Sele|
|000011b0| 63 74 44 69 61 6c 6f 67 | 49 74 65 6d 54 65 78 74 |ctDialog|ItemText|
|000011c0| 28 64 69 61 6c 6f 67 2c | 20 6b 43 6f 6d 6d 65 6e |(dialog,| kCommen|
|000011d0| 74 49 74 65 6d 2c 20 30 | 2c 20 33 32 37 36 37 29 |tItem, 0|, 32767)|
|000011e0| 3b 0d 09 53 65 74 44 69 | 61 6c 6f 67 44 65 66 61 |;..SetDi|alogDefa|
|000011f0| 75 6c 74 49 74 65 6d 28 | 64 69 61 6c 6f 67 2c 20 |ultItem(|dialog, |
|00001200| 6f 6b 29 3b 0d 09 53 65 | 74 44 69 61 6c 6f 67 43 |ok);..Se|tDialogC|
|00001210| 61 6e 63 65 6c 49 74 65 | 6d 28 64 69 61 6c 6f 67 |ancelIte|m(dialog|
|00001220| 2c 20 63 61 6e 63 65 6c | 29 3b 0d 09 53 65 74 44 |, cancel|);..SetD|
|00001230| 69 61 6c 6f 67 54 72 61 | 63 6b 73 43 75 72 73 6f |ialogTra|cksCurso|
|00001240| 72 28 64 69 61 6c 6f 67 | 2c 20 74 72 75 65 29 3b |r(dialog|, true);|
|00001250| 0d 09 53 68 6f 77 57 69 | 6e 64 6f 77 28 64 69 61 |..ShowWi|ndow(dia|
|00001260| 6c 6f 67 29 3b 0d 09 77 | 68 69 6c 65 20 28 21 64 |log);..w|hile (!d|
|00001270| 6f 6e 65 29 0d 09 7b 0d | 09 09 73 68 6f 72 74 20 |one)..{.|..short |
|00001280| 69 74 65 6d 48 69 74 3b | 0d 09 09 0d 09 09 4d 6f |itemHit;|......Mo|
|00001290| 64 61 6c 44 69 61 6c 6f | 67 28 54 68 65 46 69 6c |dalDialo|g(TheFil|
|000012a0| 74 65 72 50 72 6f 63 2c | 20 26 69 74 65 6d 48 69 |terProc,| &itemHi|
|000012b0| 74 29 3b 0d 09 09 73 77 | 69 74 63 68 20 28 69 74 |t);...sw|itch (it|
|000012c0| 65 6d 48 69 74 29 0d 09 | 09 7b 0d 09 09 63 61 73 |emHit)..|.{...cas|
|000012d0| 65 20 6f 6b 3a 0d 09 09 | 09 47 65 74 44 69 61 6c |e ok:...|.GetDial|
|000012e0| 6f 67 49 74 65 6d 28 64 | 69 61 6c 6f 67 2c 20 6b |ogItem(d|ialog, k|
|000012f0| 43 6f 6d 6d 65 6e 74 49 | 74 65 6d 2c 20 26 74 79 |CommentI|tem, &ty|
|00001300| 70 65 2c 20 26 68 2c 20 | 26 72 29 3b 0d 09 09 09 |pe, &h, |&r);....|
|00001310| 47 65 74 44 69 61 6c 6f | 67 49 74 65 6d 54 65 78 |GetDialo|gItemTex|
|00001320| 74 28 68 2c 20 73 29 3b | 0d 09 09 09 42 6c 6f 63 |t(h, s);|....Bloc|
|00001330| 6b 4d 6f 76 65 28 73 2c | 20 63 6f 6d 6d 65 6e 74 |kMove(s,| comment|
|00001340| 2c 20 73 5b 30 5d 20 2b | 20 31 29 3b 0d 09 09 09 |, s[0] +| 1);....|
|00001350| 53 61 76 65 50 72 65 76 | 69 6f 75 73 43 6f 6d 6d |SavePrev|iousComm|
|00001360| 65 6e 74 28 63 6f 6d 6d | 65 6e 74 29 3b 0d 09 09 |ent(comm|ent);...|
|00001370| 09 64 6f 6e 65 20 3d 20 | 74 72 75 65 3b 0d 09 09 |.done = |true;...|
|00001380| 09 72 65 73 75 6c 74 20 | 3d 20 74 72 75 65 3b 0d |.result |= true;.|
|00001390| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 0d 09 09 |...break|;.......|
|000013a0| 63 61 73 65 20 63 61 6e | 63 65 6c 3a 0d 09 09 09 |case can|cel:....|
|000013b0| 65 72 72 20 3d 20 75 73 | 65 72 43 61 6e 63 65 6c |err = us|erCancel|
|000013c0| 65 64 45 72 72 3b 0d 09 | 09 09 64 6f 6e 65 20 3d |edErr;..|..done =|
|000013d0| 20 74 72 75 65 3b 0d 09 | 09 09 62 72 65 61 6b 3b | true;..|..break;|
|000013e0| 0d 09 09 7d 0d 09 7d 0d | 09 44 69 73 70 6f 73 65 |...}..}.|.Dispose|
|000013f0| 44 69 61 6c 6f 67 28 64 | 69 61 6c 6f 67 29 3b 0d |Dialog(d|ialog);.|
|00001400| 09 72 65 74 75 72 6e 20 | 72 65 73 75 6c 74 3b 0d |.return |result;.|
|00001410| 7d 0d 0d 0d 42 6f 6f 6c | 65 61 6e 20 49 73 54 65 |}...Bool|ean IsTe|
|00001420| 78 74 46 69 6c 65 28 46 | 53 53 70 65 63 20 2a 66 |xtFile(F|SSpec *f|
|00001430| 69 6c 65 29 0d 7b 0d 09 | 46 49 6e 66 6f 20 69 6e |ile).{..|FInfo in|
|00001440| 66 6f 3b 0d 09 4f 53 45 | 72 72 20 65 72 72 3b 0d |fo;..OSE|rr err;.|
|00001450| 09 0d 09 65 72 72 20 3d | 20 46 53 70 47 65 74 46 |...err =| FSpGetF|
|00001460| 49 6e 66 6f 28 66 69 6c | 65 2c 20 26 69 6e 66 6f |Info(fil|e, &info|
|00001470| 29 3b 0d 09 69 66 20 28 | 65 72 72 20 21 3d 20 6e |);..if (|err != n|
|00001480| 6f 45 72 72 29 20 72 65 | 74 75 72 6e 20 66 61 6c |oErr) re|turn fal|
|00001490| 73 65 3b 0d 09 72 65 74 | 75 72 6e 20 69 6e 66 6f |se;..ret|urn info|
|000014a0| 2e 66 64 54 79 70 65 20 | 3d 3d 20 27 54 45 58 54 |.fdType |== 'TEXT|
|000014b0| 27 3b 0d 7d 0d 0d 0d 43 | 6f 6d 6d 65 6e 74 46 6f |';.}...C|ommentFo|
|000014c0| 72 6d 61 74 20 2a 47 65 | 74 43 6f 6d 6d 65 6e 74 |rmat *Ge|tComment|
|000014d0| 46 6f 72 6d 61 74 28 46 | 53 53 70 65 63 20 2a 66 |Format(F|SSpec *f|
|000014e0| 69 6c 65 29 0d 7b 0d 09 | 53 74 72 31 35 20 65 78 |ile).{..|Str15 ex|
|000014f0| 74 65 6e 73 69 6f 6e 3b | 0d 09 6c 6f 6e 67 20 69 |tension;|..long i|
|00001500| 2c 20 6c 65 6e 67 74 68 | 3b 0d 09 0d 09 2f 2a 20 |, length|;..../* |
|00001510| 67 65 74 20 74 68 65 20 | 65 78 74 65 6e 73 69 6f |get the |extensio|
|00001520| 6e 20 66 72 6f 6d 20 74 | 68 65 20 66 69 6c 65 20 |n from t|he file |
|00001530| 6e 61 6d 65 20 2a 2f 0d | 09 66 6f 72 20 28 69 20 |name */.|.for (i |
|00001540| 3d 20 66 69 6c 65 2d 3e | 6e 61 6d 65 5b 30 5d 3b |= file->|name[0];|
|00001550| 20 69 20 3e 20 30 20 26 | 26 20 66 69 6c 65 2d 3e | i > 0 &|& file->|
|00001560| 6e 61 6d 65 5b 69 5d 20 | 21 3d 20 27 2e 27 3b 20 |name[i] |!= '.'; |
|00001570| 69 2d 2d 29 0d 09 09 3b | 0d 09 6c 65 6e 67 74 68 |i--)...;|..length|
|00001580| 20 3d 20 28 66 69 6c 65 | 2d 3e 6e 61 6d 65 5b 30 | = (file|->name[0|
|00001590| 5d 20 2d 20 69 29 20 2b | 20 31 3b 0d 09 69 66 20 |] - i) +| 1;..if |
|000015a0| 28 6c 65 6e 67 74 68 20 | 3e 20 35 29 0d 09 09 72 |(length |> 5)...r|
|000015b0| 65 74 75 72 6e 20 70 43 | 6f 6d 6d 65 6e 74 46 6f |eturn pC|ommentFo|
|000015c0| 72 6d 61 74 73 20 2b 20 | 28 6b 4e 75 6d 43 6f 6d |rmats + |(kNumCom|
|000015d0| 6d 65 6e 74 46 6f 72 6d | 61 74 73 20 2d 20 31 29 |mentForm|ats - 1)|
|000015e0| 3b 0d 09 42 6c 6f 63 6b | 4d 6f 76 65 44 61 74 61 |;..Block|MoveData|
|000015f0| 28 66 69 6c 65 2d 3e 6e | 61 6d 65 20 2b 20 69 2c |(file->n|ame + i,|
|00001600| 20 65 78 74 65 6e 73 69 | 6f 6e 20 2b 20 31 2c 20 | extensi|on + 1, |
|00001610| 6c 65 6e 67 74 68 29 3b | 0d 09 65 78 74 65 6e 73 |length);|..extens|
|00001620| 69 6f 6e 5b 30 5d 20 3d | 20 6c 65 6e 67 74 68 3b |ion[0] =| length;|
|00001630| 0d 09 0d 09 2f 2a 20 6c | 6f 6f 70 20 6f 76 65 72 |..../* l|oop over|
|00001640| 20 74 68 65 20 66 6f 72 | 6d 61 74 73 20 2a 2f 0d | the for|mats */.|
|00001650| 09 66 6f 72 20 28 69 20 | 3d 20 30 3b 20 69 20 3c |.for (i |= 0; i <|
|00001660| 20 6b 4e 75 6d 43 6f 6d | 6d 65 6e 74 46 6f 72 6d | kNumCom|mentForm|
|00001670| 61 74 73 3b 20 69 2b 2b | 29 0d 09 7b 0d 09 09 69 |ats; i++|)..{...i|
|00001680| 66 20 28 45 71 75 61 6c | 53 74 72 69 6e 67 28 65 |f (Equal|String(e|
|00001690| 78 74 65 6e 73 69 6f 6e | 2c 20 70 43 6f 6d 6d 65 |xtension|, pComme|
|000016a0| 6e 74 46 6f 72 6d 61 74 | 73 5b 69 5d 2e 65 78 74 |ntFormat|s[i].ext|
|000016b0| 65 6e 73 69 6f 6e 2c 20 | 66 61 6c 73 65 2c 20 74 |ension, |false, t|
|000016c0| 72 75 65 29 29 0d 09 09 | 09 72 65 74 75 72 6e 20 |rue))...|.return |
|000016d0| 70 43 6f 6d 6d 65 6e 74 | 46 6f 72 6d 61 74 73 20 |pComment|Formats |
|000016e0| 2b 20 69 3b 0d 09 7d 0d | 09 0d 09 2f 2a 20 72 65 |+ i;..}.|.../* re|
|000016f0| 74 75 72 6e 20 74 68 65 | 20 64 65 66 61 75 6c 74 |turn the| default|
|00001700| 20 2a 2f 0d 09 72 65 74 | 75 72 6e 20 70 43 6f 6d | */..ret|urn pCom|
|00001710| 6d 65 6e 74 46 6f 72 6d | 61 74 73 20 2b 20 28 6b |mentForm|ats + (k|
|00001720| 4e 75 6d 43 6f 6d 6d 65 | 6e 74 46 6f 72 6d 61 74 |NumComme|ntFormat|
|00001730| 73 20 2d 20 31 29 3b 0d | 7d 0d 0d 0d 4f 53 45 72 |s - 1);.|}...OSEr|
|00001740| 72 20 53 75 62 73 74 69 | 74 75 74 65 43 6f 6d 6d |r Substi|tuteComm|
|00001750| 65 6e 74 73 28 53 74 72 | 69 6e 67 48 61 6e 64 6c |ents(Str|ingHandl|
|00001760| 65 20 68 65 61 64 65 72 | 2c 20 43 6f 6d 6d 65 6e |e header|, Commen|
|00001770| 74 46 6f 72 6d 61 74 20 | 2a 66 6f 72 6d 61 74 29 |tFormat |*format)|
|00001780| 0d 7b 0d 09 4f 53 45 72 | 72 20 65 72 72 3b 0d 09 |.{..OSEr|r err;..|
|00001790| 65 72 72 20 3d 20 52 65 | 70 6c 61 63 65 53 74 72 |err = Re|placeStr|
|000017a0| 69 6e 67 28 68 65 61 64 | 65 72 2c 20 22 5c 70 3c |ing(head|er, "\p<|
|000017b0| 63 6f 6d 6d 65 6e 74 20 | 73 74 61 72 74 3e 22 2c |comment |start>",|
|000017c0| 20 66 6f 72 6d 61 74 2d | 3e 63 6f 6d 6d 65 6e 74 | format-|>comment|
|000017d0| 53 74 61 72 74 29 3b 0d | 09 69 66 20 28 65 72 72 |Start);.|.if (err|
|000017e0| 20 3c 20 6e 6f 45 72 72 | 29 20 72 65 74 75 72 6e | < noErr|) return|
|000017f0| 20 65 72 72 3b 0d 09 65 | 72 72 20 3d 20 52 65 70 | err;..e|rr = Rep|
|00001800| 6c 61 63 65 53 74 72 69 | 6e 67 28 68 65 61 64 65 |laceStri|ng(heade|
|00001810| 72 2c 20 22 5c 70 3c 6c | 69 6e 65 20 73 74 61 72 |r, "\p<l|ine star|
|00001820| 74 3e 22 2c 20 66 6f 72 | 6d 61 74 2d 3e 6c 69 6e |t>", for|mat->lin|
|00001830| 65 53 74 61 72 74 29 3b | 0d 09 69 66 20 28 65 72 |eStart);|..if (er|
|00001840| 72 20 3c 20 6e 6f 45 72 | 72 29 20 72 65 74 75 72 |r < noEr|r) retur|
|00001850| 6e 20 65 72 72 3b 0d 09 | 65 72 72 20 3d 20 52 65 |n err;..|err = Re|
|00001860| 70 6c 61 63 65 53 74 72 | 69 6e 67 28 68 65 61 64 |placeStr|ing(head|
|00001870| 65 72 2c 20 22 5c 70 3c | 6c 69 6e 65 20 65 6e 64 |er, "\p<|line end|
|00001880| 3e 22 2c 20 66 6f 72 6d | 61 74 2d 3e 6c 69 6e 65 |>", form|at->line|
|00001890| 45 6e 64 29 3b 0d 09 69 | 66 20 28 65 72 72 20 3c |End);..i|f (err <|
|000018a0| 20 6e 6f 45 72 72 29 20 | 72 65 74 75 72 6e 20 65 | noErr) |return e|
|000018b0| 72 72 3b 0d 09 65 72 72 | 20 3d 20 52 65 70 6c 61 |rr;..err| = Repla|
|000018c0| 63 65 53 74 72 69 6e 67 | 28 68 65 61 64 65 72 2c |ceString|(header,|
|000018d0| 20 22 5c 70 3c 62 6c 61 | 6e 6b 20 6c 69 6e 65 3e | "\p<bla|nk line>|
|000018e0| 22 2c 20 66 6f 72 6d 61 | 74 2d 3e 62 6c 61 6e 6b |", forma|t->blank|
|000018f0| 4c 69 6e 65 29 3b 0d 09 | 69 66 20 28 65 72 72 20 |Line);..|if (err |
|00001900| 3c 20 6e 6f 45 72 72 29 | 20 72 65 74 75 72 6e 20 |< noErr)| return |
|00001910| 65 72 72 3b 0d 09 69 66 | 20 28 65 72 72 20 3e 20 |err;..if| (err > |
|00001920| 6e 6f 45 72 72 29 20 65 | 72 72 20 3d 20 6e 6f 45 |noErr) e|rr = noE|
|00001930| 72 72 3b 0d 09 72 65 74 | 75 72 6e 20 65 72 72 3b |rr;..ret|urn err;|
|00001940| 0d 7d 0d 0d 0d 0d 4f 53 | 45 72 72 20 47 65 74 48 |.}....OS|Err GetH|
|00001950| 65 61 64 65 72 46 72 6f | 6d 46 69 6c 65 28 48 61 |eaderFro|mFile(Ha|
|00001960| 6e 64 6c 65 20 66 69 6c | 65 44 61 74 61 2c 20 43 |ndle fil|eData, C|
|00001970| 6f 6d 6d 65 6e 74 46 6f | 72 6d 61 74 20 2a 66 6f |ommentFo|rmat *fo|
|00001980| 72 6d 61 74 2c 0d 09 09 | 09 09 09 09 53 74 72 69 |rmat,...|....Stri|
|00001990| 6e 67 48 61 6e 64 6c 65 | 20 62 6c 61 6e 6b 48 65 |ngHandle| blankHe|
|000019a0| 61 64 65 72 2c 20 53 74 | 72 69 6e 67 48 61 6e 64 |ader, St|ringHand|
|000019b0| 6c 65 20 2a 68 65 61 64 | 65 72 29 0d 7b 0d 09 4f |le *head|er).{..O|
|000019c0| 53 45 72 72 20 65 72 72 | 3b 0d 09 42 79 74 65 20 |SErr err|;..Byte |
|000019d0| 68 65 61 64 65 72 53 74 | 61 74 65 2c 20 66 69 6c |headerSt|ate, fil|
|000019e0| 65 53 74 61 74 65 3b 0d | 09 53 74 72 69 6e 67 50 |eState;.|.StringP|
|000019f0| 74 72 20 66 69 6c 65 4c | 69 6e 65 3b 0d 09 53 74 |tr fileL|ine;..St|
|00001a00| 72 69 6e 67 50 74 72 20 | 68 65 61 64 65 72 4c 69 |ringPtr |headerLi|
|00001a10| 6e 65 3b 0d 09 42 6f 6f | 6c 65 61 6e 20 6c 69 6e |ne;..Boo|lean lin|
|00001a20| 65 44 6f 65 73 6e 74 4d | 61 74 63 68 3b 0d 09 42 |eDoesntM|atch;..B|
|00001a30| 6f 6f 6c 65 61 6e 20 6e | 65 76 65 72 4d 61 74 63 |oolean n|everMatc|
|00001a40| 68 65 64 3b 0d 09 42 6f | 6f 6c 65 61 6e 20 6c 61 |hed;..Bo|olean la|
|00001a50| 73 74 4c 69 6e 65 4d 61 | 74 63 68 65 64 43 6f 6d |stLineMa|tchedCom|
|00001a60| 6d 65 6e 74 45 6e 64 3b | 0d 09 6c 6f 6e 67 20 68 |mentEnd;|..long h|
|00001a70| 65 61 64 65 72 4c 69 6e | 65 4c 65 6e 67 74 68 2c |eaderLin|eLength,|
|00001a80| 20 68 65 61 64 65 72 4c | 65 6e 67 74 68 2c 20 66 | headerL|ength, f|
|00001a90| 69 6c 65 4c 69 6e 65 4c | 65 6e 67 74 68 2c 20 66 |ileLineL|ength, f|
|00001aa0| 69 6c 65 4c 65 6e 67 74 | 68 3b 0d 09 0d 09 2f 2a |ileLengt|h;..../*|
|00001ab0| 20 6c 6f 6f 70 20 6f 76 | 65 72 20 6c 69 6e 65 73 | loop ov|er lines|
|00001ac0| 20 74 6f 20 6d 61 74 63 | 68 20 65 61 63 68 20 6c | to matc|h each l|
|00001ad0| 69 6e 65 20 6f 66 20 62 | 6c 61 6e 6b 20 68 65 61 |ine of b|lank hea|
|00001ae0| 64 65 72 2c 0d 09 20 2a | 20 61 63 63 75 6d 75 6c |der,.. *| accumul|
|00001af0| 61 74 69 6e 67 20 6c 69 | 6e 65 73 20 69 6e 74 6f |ating li|nes into|
|00001b00| 20 74 68 65 20 68 65 61 | 64 65 72 20 73 74 72 69 | the hea|der stri|
|00001b10| 6e 67 20 68 61 6e 64 6c | 65 0d 09 20 2a 2f 0d 09 |ng handl|e.. */..|
|00001b20| 2a 68 65 61 64 65 72 20 | 3d 20 4e 55 4c 4c 3b 0d |*header |= NULL;.|
|00001b30| 09 68 65 61 64 65 72 53 | 74 61 74 65 20 3d 20 48 |.headerS|tate = H|
|00001b40| 47 65 74 53 74 61 74 65 | 28 62 6c 61 6e 6b 48 65 |GetState|(blankHe|
|00001b50| 61 64 65 72 29 3b 0d 09 | 48 4c 6f 63 6b 28 62 6c |ader);..|HLock(bl|
|00001b60| 61 6e 6b 48 65 61 64 65 | 72 29 3b 0d 09 66 69 6c |ankHeade|r);..fil|
|00001b70| 65 53 74 61 74 65 20 3d | 20 48 47 65 74 53 74 61 |eState =| HGetSta|
|00001b80| 74 65 28 66 69 6c 65 44 | 61 74 61 29 3b 0d 09 48 |te(fileD|ata);..H|
|00001b90| 4c 6f 63 6b 28 66 69 6c | 65 44 61 74 61 29 3b 0d |Lock(fil|eData);.|
|00001ba0| 09 66 69 6c 65 4c 65 6e | 67 74 68 20 3d 20 47 65 |.fileLen|gth = Ge|
|00001bb0| 74 48 61 6e 64 6c 65 53 | 69 7a 65 28 66 69 6c 65 |tHandleS|ize(file|
|00001bc0| 44 61 74 61 29 3b 0d 09 | 68 65 61 64 65 72 4c 65 |Data);..|headerLe|
|00001bd0| 6e 67 74 68 20 3d 20 47 | 65 74 48 61 6e 64 6c 65 |ngth = G|etHandle|
|00001be0| 53 69 7a 65 28 62 6c 61 | 6e 6b 48 65 61 64 65 72 |Size(bla|nkHeader|
|00001bf0| 29 3b 0d 09 68 65 61 64 | 65 72 4c 69 6e 65 20 3d |);..head|erLine =|
|00001c00| 20 2a 62 6c 61 6e 6b 48 | 65 61 64 65 72 3b 0d 09 | *blankH|eader;..|
|00001c10| 66 69 6c 65 4c 69 6e 65 | 20 3d 20 2a 66 69 6c 65 |fileLine| = *file|
|00001c20| 44 61 74 61 3b 0d 09 68 | 65 61 64 65 72 4c 69 6e |Data;..h|eaderLin|
|00001c30| 65 4c 65 6e 67 74 68 20 | 3d 20 4c 69 6e 65 53 69 |eLength |= LineSi|
|00001c40| 7a 65 28 68 65 61 64 65 | 72 4c 69 6e 65 2c 20 68 |ze(heade|rLine, h|
|00001c50| 65 61 64 65 72 4c 65 6e | 67 74 68 29 3b 0d 09 66 |eaderLen|gth);..f|
|00001c60| 69 6c 65 4c 69 6e 65 4c | 65 6e 67 74 68 20 3d 20 |ileLineL|ength = |
|00001c70| 4c 69 6e 65 53 69 7a 65 | 28 66 69 6c 65 4c 69 6e |LineSize|(fileLin|
|00001c80| 65 2c 20 66 69 6c 65 4c | 65 6e 67 74 68 29 3b 0d |e, fileL|ength);.|
|00001c90| 09 6c 69 6e 65 44 6f 65 | 73 6e 74 4d 61 74 63 68 |.lineDoe|sntMatch|
|00001ca0| 20 3d 20 74 72 75 65 3b | 0d 09 6e 65 76 65 72 4d | = true;|..neverM|
|00001cb0| 61 74 63 68 65 64 20 3d | 20 74 72 75 65 3b 0d 09 |atched =| true;..|
|00001cc0| 6c 61 73 74 4c 69 6e 65 | 4d 61 74 63 68 65 64 43 |lastLine|MatchedC|
|00001cd0| 6f 6d 6d 65 6e 74 45 6e | 64 20 3d 20 66 61 6c 73 |ommentEn|d = fals|
|00001ce0| 65 3b 0d 09 64 6f 0d 09 | 7b 0d 09 09 2f 2a 20 63 |e;..do..|{.../* c|
|00001cf0| 68 65 63 6b 20 66 6f 72 | 20 65 6e 64 20 6f 66 20 |heck for| end of |
|00001d00| 63 6f 6d 6d 65 6e 74 20 | 2d 2d 20 69 74 20 6d 65 |comment |-- it me|
|00001d10| 61 6e 73 20 66 61 69 6c | 75 72 65 20 77 68 65 6e |ans fail|ure when|
|00001d20| 20 66 6f 6c 6c 6f 77 65 | 64 20 62 79 20 61 20 62 | followe|d by a b|
|00001d30| 6c 61 6e 6b 20 6c 69 6e | 65 20 2a 2f 0d 09 09 69 |lank lin|e */...i|
|00001d40| 66 20 28 6c 61 73 74 4c | 69 6e 65 4d 61 74 63 68 |f (lastL|ineMatch|
|00001d50| 65 64 43 6f 6d 6d 65 6e | 74 45 6e 64 20 26 26 20 |edCommen|tEnd && |
|00001d60| 66 69 6c 65 4c 69 6e 65 | 4c 65 6e 67 74 68 20 3d |fileLine|Length =|
|00001d70| 3d 20 31 20 26 26 20 2a | 66 69 6c 65 4c 69 6e 65 |= 1 && *|fileLine|
|00001d80| 20 3d 3d 20 27 5c 6e 27 | 29 0d 09 09 7b 0d 09 09 | == '\n'|)...{...|
|00001d90| 09 65 72 72 20 3d 20 2d | 31 3b 0d 09 09 09 62 72 |.err = -|1;....br|
|00001da0| 65 61 6b 3b 0d 09 09 7d | 0d 09 09 0d 09 09 6c 61 |eak;...}|......la|
|00001db0| 73 74 4c 69 6e 65 4d 61 | 74 63 68 65 64 43 6f 6d |stLineMa|tchedCom|
|00001dc0| 6d 65 6e 74 45 6e 64 20 | 3d 20 4d 61 74 63 68 4c |mentEnd |= MatchL|
|00001dd0| 69 6e 65 28 66 69 6c 65 | 4c 69 6e 65 2c 20 66 69 |ine(file|Line, fi|
|00001de0| 6c 65 4c 69 6e 65 4c 65 | 6e 67 74 68 2c 20 66 6f |leLineLe|ngth, fo|
|00001df0| 72 6d 61 74 2d 3e 63 6f | 6d 6d 65 6e 74 45 6e 64 |rmat->co|mmentEnd|
|00001e00| 20 2b 20 31 2c 20 66 6f | 72 6d 61 74 2d 3e 63 6f | + 1, fo|rmat->co|
|00001e10| 6d 6d 65 6e 74 45 6e 64 | 5b 30 5d 29 3b 0d 0d 09 |mmentEnd|[0]);...|
|00001e20| 09 69 66 20 28 4d 61 74 | 63 68 4c 69 6e 65 55 6e |.if (Mat|chLineUn|
|00001e30| 74 69 6c 43 68 61 72 28 | 66 69 6c 65 4c 69 6e 65 |tilChar(|fileLine|
|00001e40| 2c 20 66 69 6c 65 4c 69 | 6e 65 4c 65 6e 67 74 68 |, fileLi|neLength|
|00001e50| 2c 20 68 65 61 64 65 72 | 4c 69 6e 65 2c 20 68 65 |, header|Line, he|
|00001e60| 61 64 65 72 4c 69 6e 65 | 4c 65 6e 67 74 68 2c 20 |aderLine|Length, |
|00001e70| 27 3c 27 29 29 0d 09 09 | 7b 0d 09 09 09 6c 69 6e |'<'))...|{....lin|
|00001e80| 65 44 6f 65 73 6e 74 4d | 61 74 63 68 20 3d 20 6e |eDoesntM|atch = n|
|00001e90| 65 76 65 72 4d 61 74 63 | 68 65 64 20 3d 20 66 61 |everMatc|hed = fa|
|00001ea0| 6c 73 65 3b 0d 09 09 09 | 0d 09 09 09 2f 2a 20 73 |lse;....|..../* s|
|00001eb0| 74 61 72 74 20 6d 61 74 | 63 68 69 6e 67 20 66 69 |tart mat|ching fi|
|00001ec0| 6c 65 20 74 6f 20 6e 65 | 78 74 20 68 65 61 64 65 |le to ne|xt heade|
|00001ed0| 72 20 6c 69 6e 65 20 2a | 2f 0d 09 09 09 68 65 61 |r line *|/....hea|
|00001ee0| 64 65 72 4c 69 6e 65 20 | 2b 3d 20 68 65 61 64 65 |derLine |+= heade|
|00001ef0| 72 4c 69 6e 65 4c 65 6e | 67 74 68 3b 0d 09 09 09 |rLineLen|gth;....|
|00001f00| 68 65 61 64 65 72 4c 65 | 6e 67 74 68 20 2d 3d 20 |headerLe|ngth -= |
|00001f10| 68 65 61 64 65 72 4c 69 | 6e 65 4c 65 6e 67 74 68 |headerLi|neLength|
|00001f20| 3b 0d 09 09 09 68 65 61 | 64 65 72 4c 69 6e 65 4c |;....hea|derLineL|
|00001f30| 65 6e 67 74 68 20 3d 20 | 4c 69 6e 65 53 69 7a 65 |ength = |LineSize|
|00001f40| 28 68 65 61 64 65 72 4c | 69 6e 65 2c 20 68 65 61 |(headerL|ine, hea|
|00001f50| 64 65 72 4c 65 6e 67 74 | 68 29 3b 0d 09 09 09 0d |derLengt|h);.....|
|00001f60| 09 09 09 2f 2a 20 73 6b | 69 70 20 62 6c 61 6e 6b |.../* sk|ip blank|
|00001f70| 20 6c 69 6e 65 73 20 69 | 6e 20 68 65 61 64 65 72 | lines i|n header|
|00001f80| 20 2a 2f 0d 09 09 09 77 | 68 69 6c 65 20 28 68 65 | */....w|hile (he|
|00001f90| 61 64 65 72 4c 65 6e 67 | 74 68 20 3e 20 30 0d 09 |aderLeng|th > 0..|
|00001fa0| 09 09 09 20 20 20 26 26 | 20 4d 61 74 63 68 4c 69 |... &&| MatchLi|
|00001fb0| 6e 65 28 68 65 61 64 65 | 72 4c 69 6e 65 2c 20 68 |ne(heade|rLine, h|
|00001fc0| 65 61 64 65 72 4c 69 6e | 65 4c 65 6e 67 74 68 2c |eaderLin|eLength,|
|00001fd0| 20 66 6f 72 6d 61 74 2d | 3e 6c 69 6e 65 53 74 61 | format-|>lineSta|
|00001fe0| 72 74 20 2b 20 31 2c 0d | 09 09 09 09 20 20 20 09 |rt + 1,.|.... .|
|00001ff0| 09 09 09 66 6f 72 6d 61 | 74 2d 3e 6c 69 6e 65 53 |...forma|t->lineS|
|00002000| 74 61 72 74 5b 30 5d 29 | 29 0d 09 09 09 7b 0d 09 |tart[0])|)....{..|
|00002010| 09 09 09 68 65 61 64 65 | 72 4c 69 6e 65 20 2b 3d |...heade|rLine +=|
|00002020| 20 68 65 61 64 65 72 4c | 69 6e 65 4c 65 6e 67 74 | headerL|ineLengt|
|00002030| 68 3b 0d 09 09 09 09 68 | 65 61 64 65 72 4c 65 6e |h;.....h|eaderLen|
|00002040| 67 74 68 20 2d 3d 20 68 | 65 61 64 65 72 4c 69 6e |gth -= h|eaderLin|
|00002050| 65 4c 65 6e 67 74 68 3b | 0d 09 09 09 09 68 65 61 |eLength;|.....hea|
|00002060| 64 65 72 4c 69 6e 65 4c | 65 6e 67 74 68 20 3d 20 |derLineL|ength = |
|00002070| 4c 69 6e 65 53 69 7a 65 | 28 68 65 61 64 65 72 4c |LineSize|(headerL|
|00002080| 69 6e 65 2c 20 68 65 61 | 64 65 72 4c 65 6e 67 74 |ine, hea|derLengt|
|00002090| 68 29 3b 0d 09 09 09 7d | 0d 09 09 7d 0d 09 09 65 |h);....}|...}...e|
|000020a0| 6c 73 65 0d 09 09 7b 0d | 09 09 09 6c 69 6e 65 44 |lse...{.|...lineD|
|000020b0| 6f 65 73 6e 74 4d 61 74 | 63 68 20 3d 20 74 72 75 |oesntMat|ch = tru|
|000020c0| 65 3b 0d 09 09 09 0d 09 | 09 09 2f 2a 20 69 74 27 |e;......|../* it'|
|000020d0| 73 20 4f 4b 20 69 66 20 | 61 20 6c 69 6e 65 20 64 |s OK if |a line d|
|000020e0| 6f 65 73 6e 27 74 20 6d | 61 74 63 68 20 61 73 20 |oesn't m|atch as |
|000020f0| 6c 6f 6e 67 20 61 73 20 | 77 65 20 68 61 76 65 20 |long as |we have |
|00002100| 62 65 65 6e 20 6d 61 74 | 63 68 69 6e 67 0d 09 09 |been mat|ching...|
|00002110| 09 20 2a 20 75 70 20 74 | 6f 20 74 68 69 73 20 70 |. * up t|o this p|
|00002120| 6f 69 6e 74 2c 20 62 65 | 63 61 75 73 65 20 65 78 |oint, be|cause ex|
|00002130| 74 72 61 20 6c 69 6e 65 | 73 20 6f 66 20 63 6f 6d |tra line|s of com|
|00002140| 6d 65 6e 74 20 61 72 65 | 20 4f 4b 2e 0d 09 09 09 |ment are| OK.....|
|00002150| 20 2a 2f 0d 09 09 09 69 | 66 20 28 6e 65 76 65 72 | */....i|f (never|
|00002160| 4d 61 74 63 68 65 64 29 | 20 62 72 65 61 6b 3b 0d |Matched)| break;.|
|00002170| 09 09 7d 0d 09 09 0d 09 | 09 2f 2a 20 61 63 63 75 |..}.....|./* accu|
|00002180| 6d 75 6c 61 74 65 20 6c | 69 6e 65 20 69 6e 74 6f |mulate l|ine into|
|00002190| 20 68 65 61 64 65 72 20 | 68 61 6e 64 6c 65 20 2a | header |handle *|
|000021a0| 2f 0d 09 09 69 66 20 28 | 2a 68 65 61 64 65 72 20 |/...if (|*header |
|000021b0| 3d 3d 20 4e 55 4c 4c 29 | 0d 09 09 7b 0d 09 09 09 |== NULL)|...{....|
|000021c0| 2a 68 65 61 64 65 72 20 | 3d 20 54 65 6d 70 4e 65 |*header |= TempNe|
|000021d0| 77 48 61 6e 64 6c 65 28 | 30 2c 20 26 65 72 72 29 |wHandle(|0, &err)|
|000021e0| 3b 0d 09 09 09 69 66 20 | 28 65 72 72 20 21 3d 20 |;....if |(err != |
|000021f0| 6e 6f 45 72 72 29 20 62 | 72 65 61 6b 3b 0d 09 09 |noErr) b|reak;...|
|00002200| 7d 0d 09 09 65 72 72 20 | 3d 20 50 74 72 41 6e 64 |}...err |= PtrAnd|
|00002210| 48 61 6e 64 28 66 69 6c | 65 4c 69 6e 65 2c 20 2a |Hand(fil|eLine, *|
|00002220| 68 65 61 64 65 72 2c 20 | 66 69 6c 65 4c 69 6e 65 |header, |fileLine|
|00002230| 4c 65 6e 67 74 68 29 3b | 0d 09 09 0d 09 09 2f 2a |Length);|....../*|
|00002240| 20 61 64 76 61 6e 63 65 | 20 74 68 65 20 66 69 6c | advance| the fil|
|00002250| 65 20 64 61 74 61 20 70 | 6f 69 6e 74 65 72 20 2a |e data p|ointer *|
|00002260| 2f 0d 09 09 66 69 6c 65 | 4c 69 6e 65 20 2b 3d 20 |/...file|Line += |
|00002270| 66 69 6c 65 4c 69 6e 65 | 4c 65 6e 67 74 68 3b 0d |fileLine|Length;.|
|00002280| 09 09 66 69 6c 65 4c 65 | 6e 67 74 68 20 2d 3d 20 |..fileLe|ngth -= |
|00002290| 66 69 6c 65 4c 69 6e 65 | 4c 65 6e 67 74 68 3b 0d |fileLine|Length;.|
|000022a0| 09 09 66 69 6c 65 4c 69 | 6e 65 4c 65 6e 67 74 68 |..fileLi|neLength|
|000022b0| 20 3d 20 4c 69 6e 65 53 | 69 7a 65 28 66 69 6c 65 | = LineS|ize(file|
|000022c0| 4c 69 6e 65 2c 20 66 69 | 6c 65 4c 65 6e 67 74 68 |Line, fi|leLength|
|000022d0| 29 3b 0d 0d 09 7d 20 77 | 68 69 6c 65 20 28 65 72 |);...} w|hile (er|
|000022e0| 72 20 3d 3d 20 6e 6f 45 | 72 72 20 26 26 20 68 65 |r == noE|rr && he|
|000022f0| 61 64 65 72 4c 65 6e 67 | 74 68 20 3e 20 30 20 26 |aderLeng|th > 0 &|
|00002300| 26 20 66 69 6c 65 4c 65 | 6e 67 74 68 20 3e 20 30 |& fileLe|ngth > 0|
|00002310| 29 3b 0d 09 0d 09 48 53 | 65 74 53 74 61 74 65 28 |);....HS|etState(|
|00002320| 66 69 6c 65 44 61 74 61 | 2c 20 66 69 6c 65 53 74 |fileData|, fileSt|
|00002330| 61 74 65 29 3b 0d 09 48 | 53 65 74 53 74 61 74 65 |ate);..H|SetState|
|00002340| 28 62 6c 61 6e 6b 48 65 | 61 64 65 72 2c 20 68 65 |(blankHe|ader, he|
|00002350| 61 64 65 72 53 74 61 74 | 65 29 3b 0d 09 0d 09 69 |aderStat|e);....i|
|00002360| 66 20 28 6c 69 6e 65 44 | 6f 65 73 6e 74 4d 61 74 |f (lineD|oesntMat|
|00002370| 63 68 20 7c 7c 20 65 72 | 72 20 21 3d 20 6e 6f 45 |ch || er|r != noE|
|00002380| 72 72 29 0d 09 7b 0d 09 | 09 2f 2a 20 58 58 58 20 |rr)..{..|./* XXX |
|00002390| 70 75 74 20 75 70 20 61 | 20 22 68 65 61 64 65 72 |put up a| "header|
|000023a0| 20 63 6f 72 72 75 70 74 | 22 20 77 61 72 6e 69 6e | corrupt|" warnin|
|000023b0| 67 20 77 68 65 6e 20 73 | 6f 6d 65 74 68 69 6e 67 |g when s|omething|
|000023c0| 20 6d 61 74 63 68 65 64 | 20 2a 2f 0d 09 09 69 66 | matched| */...if|
|000023d0| 20 28 2a 68 65 61 64 65 | 72 20 21 3d 20 4e 55 4c | (*heade|r != NUL|
|000023e0| 4c 29 0d 09 09 7b 0d 09 | 09 09 44 69 73 70 6f 73 |L)...{..|..Dispos|
|000023f0| 65 48 61 6e 64 6c 65 28 | 2a 68 65 61 64 65 72 29 |eHandle(|*header)|
|00002400| 3b 0d 09 09 09 2a 68 65 | 61 64 65 72 20 3d 20 4e |;....*he|ader = N|
|00002410| 55 4c 4c 3b 0d 09 09 7d | 0d 09 7d 0d 09 0d 09 72 |ULL;...}|..}....r|
|00002420| 65 74 75 72 6e 20 28 6c | 69 6e 65 44 6f 65 73 6e |eturn (l|ineDoesn|
|00002430| 74 4d 61 74 63 68 20 26 | 26 20 65 72 72 20 3d 3d |tMatch &|& err ==|
|00002440| 20 6e 6f 45 72 72 29 20 | 3f 20 2d 31 20 3a 20 65 | noErr) |? -1 : e|
|00002450| 72 72 3b 0d 7d 0d 0d 0d | 4f 53 45 72 72 20 50 61 |rr;.}...|OSErr Pa|
|00002460| 64 54 6f 43 6f 6c 75 6d | 6e 28 48 61 6e 64 6c 65 |dToColum|n(Handle|
|00002470| 20 68 2c 20 6c 6f 6e 67 | 20 63 6f 6c 75 6d 6e 29 | h, long| column)|
|00002480| 0d 7b 0d 09 4f 53 45 72 | 72 20 65 72 72 3b 0d 09 |.{..OSEr|r err;..|
|00002490| 6c 6f 6e 67 20 6c 69 6e | 65 53 74 61 72 74 2c 20 |long lin|eStart, |
|000024a0| 69 3b 0d 09 6c 6f 6e 67 | 20 73 69 7a 65 4e 6f 77 |i;..long| sizeNow|
|000024b0| 20 3d 20 47 65 74 48 61 | 6e 64 6c 65 53 69 7a 65 | = GetHa|ndleSize|
|000024c0| 28 68 29 2c 20 6e 65 77 | 53 69 7a 65 3b 0d 09 0d |(h), new|Size;...|
|000024d0| 09 2f 2a 20 74 72 61 63 | 6b 20 62 61 63 6b 77 61 |./* trac|k backwa|
|000024e0| 72 64 73 20 6c 6f 6f 6b | 69 6e 67 20 66 6f 72 20 |rds look|ing for |
|000024f0| 65 6e 64 20 6f 66 20 6c | 69 6e 65 20 2a 2f 0d 09 |end of l|ine */..|
|00002500| 66 6f 72 20 28 6c 69 6e | 65 53 74 61 72 74 20 3d |for (lin|eStart =|
|00002510| 20 73 69 7a 65 4e 6f 77 | 3b 20 6c 69 6e 65 53 74 | sizeNow|; lineSt|
|00002520| 61 72 74 20 3e 20 30 20 | 26 26 20 28 2a 68 29 5b |art > 0 |&& (*h)[|
|00002530| 6c 69 6e 65 53 74 61 72 | 74 2d 31 5d 20 21 3d 20 |lineStar|t-1] != |
|00002540| 27 5c 6e 27 3b 20 6c 69 | 6e 65 53 74 61 72 74 2d |'\n'; li|neStart-|
|00002550| 2d 29 0d 09 09 3b 0d 09 | 0d 09 69 66 20 28 73 69 |-)...;..|..if (si|
|00002560| 7a 65 4e 6f 77 20 2d 20 | 6c 69 6e 65 53 74 61 72 |zeNow - |lineStar|
|00002570| 74 20 3e 3d 20 63 6f 6c | 75 6d 6e 29 0d 09 7b 0d |t >= col|umn)..{.|
|00002580| 09 09 2f 2a 20 61 6c 72 | 65 61 64 79 20 67 6f 6e |../* alr|eady gon|
|00002590| 65 20 74 6f 6f 20 66 61 | 72 20 2d 2d 20 69 6e 73 |e too fa|r -- ins|
|000025a0| 65 72 74 20 61 20 73 69 | 6e 67 6c 65 20 73 70 61 |ert a si|ngle spa|
|000025b0| 63 65 20 2a 2f 0d 09 09 | 53 65 74 48 61 6e 64 6c |ce */...|SetHandl|
|000025c0| 65 53 69 7a 65 28 68 2c | 20 73 69 7a 65 4e 6f 77 |eSize(h,| sizeNow|
|000025d0| 20 2b 20 31 29 3b 0d 09 | 09 65 72 72 20 3d 20 4d | + 1);..|.err = M|
|000025e0| 65 6d 45 72 72 6f 72 28 | 29 3b 0d 09 09 69 66 20 |emError(|);...if |
|000025f0| 28 65 72 72 20 21 3d 20 | 6e 6f 45 72 72 29 20 72 |(err != |noErr) r|
|00002600| 65 74 75 72 6e 20 65 72 | 72 3b 0d 09 09 28 2a 68 |eturn er|r;...(*h|
|00002610| 29 5b 73 69 7a 65 4e 6f | 77 5d 20 3d 20 27 20 27 |)[sizeNo|w] = ' '|
|00002620| 3b 0d 09 09 72 65 74 75 | 72 6e 20 6e 6f 45 72 72 |;...retu|rn noErr|
|00002630| 3b 0d 09 7d 0d 09 0d 09 | 2f 2a 20 61 64 64 20 73 |;..}....|/* add s|
|00002640| 70 61 63 65 73 20 75 6e | 74 69 6c 20 77 65 20 67 |paces un|til we g|
|00002650| 65 74 20 74 6f 20 74 68 | 65 20 63 6f 6c 75 6d 6e |et to th|e column|
|00002660| 20 2a 2f 0d 09 6e 65 77 | 53 69 7a 65 20 3d 20 73 | */..new|Size = s|
|00002670| 69 7a 65 4e 6f 77 20 2b | 20 28 63 6f 6c 75 6d 6e |izeNow +| (column|
|00002680| 20 2d 20 28 73 69 7a 65 | 4e 6f 77 20 2d 20 6c 69 | - (size|Now - li|
|00002690| 6e 65 53 74 61 72 74 29 | 29 3b 0d 09 53 65 74 48 |neStart)|);..SetH|
|000026a0| 61 6e 64 6c 65 53 69 7a | 65 28 68 2c 20 6e 65 77 |andleSiz|e(h, new|
|000026b0| 53 69 7a 65 29 3b 0d 09 | 65 72 72 20 3d 20 4d 65 |Size);..|err = Me|
|000026c0| 6d 45 72 72 6f 72 28 29 | 3b 0d 09 69 66 20 28 65 |mError()|;..if (e|
|000026d0| 72 72 20 21 3d 20 6e 6f | 45 72 72 29 20 72 65 74 |rr != no|Err) ret|
|000026e0| 75 72 6e 20 65 72 72 3b | 0d 09 66 6f 72 20 28 69 |urn err;|..for (i|
|000026f0| 20 3d 20 73 69 7a 65 4e | 6f 77 3b 20 69 20 3c 20 | = sizeN|ow; i < |
|00002700| 6e 65 77 53 69 7a 65 3b | 20 69 2b 2b 29 0d 09 09 |newSize;| i++)...|
|00002710| 28 2a 68 29 5b 69 5d 20 | 3d 20 27 20 27 3b 0d 09 |(*h)[i] |= ' ';..|
|00002720| 72 65 74 75 72 6e 20 6e | 6f 45 72 72 3b 0d 7d 0d |return n|oErr;.}.|
|00002730| 0d 0d 42 6f 6f 6c 65 61 | 6e 20 49 73 43 68 61 6e |..Boolea|n IsChan|
|00002740| 67 65 43 6f 6d 6d 65 6e | 74 53 74 61 72 74 4c 69 |geCommen|tStartLi|
|00002750| 6e 65 28 53 74 72 69 6e | 67 50 74 72 20 68 65 61 |ne(Strin|gPtr hea|
|00002760| 64 65 72 4c 69 6e 65 2c | 20 6c 6f 6e 67 20 6c 65 |derLine,| long le|
|00002770| 6e 67 74 68 2c 0d 09 09 | 09 09 09 09 09 09 20 43 |ngth,...|...... C|
|00002780| 6f 6d 6d 65 6e 74 46 6f | 72 6d 61 74 20 2a 66 6f |ommentFo|rmat *fo|
|00002790| 72 6d 61 74 29 0d 7b 0d | 09 53 74 72 69 6e 67 50 |rmat).{.|.StringP|
|000027a0| 74 72 20 73 20 3d 20 68 | 65 61 64 65 72 4c 69 6e |tr s = h|eaderLin|
|000027b0| 65 3b 0d 09 0d 09 2f 2a | 20 6d 61 74 63 68 20 74 |e;..../*| match t|
|000027c0| 68 65 20 73 74 61 72 74 | 20 6f 66 20 6c 69 6e 65 |he start| of line|
|000027d0| 20 73 65 71 75 65 6e 63 | 65 2c 20 69 66 20 6e 6f | sequenc|e, if no|
|000027e0| 74 20 6e 75 6c 6c 20 2a | 2f 0d 09 69 66 20 28 66 |t null *|/..if (f|
|000027f0| 6f 72 6d 61 74 2d 3e 6c | 69 6e 65 53 74 61 72 74 |ormat->l|ineStart|
|00002800| 20 21 3d 20 4e 55 4c 4c | 20 26 26 20 2a 66 6f 72 | != NULL| && *for|
|00002810| 6d 61 74 2d 3e 6c 69 6e | 65 53 74 61 72 74 20 21 |mat->lin|eStart !|
|00002820| 3d 20 30 29 0d 09 7b 0d | 09 09 6c 6f 6e 67 20 6c |= 0)..{.|..long l|
|00002830| 65 6e 32 20 3d 20 66 6f | 72 6d 61 74 2d 3e 6c 69 |en2 = fo|rmat->li|
|00002840| 6e 65 53 74 61 72 74 5b | 30 5d 3b 0d 09 09 53 74 |neStart[|0];...St|
|00002850| 72 69 6e 67 50 74 72 20 | 73 32 20 3d 20 66 6f 72 |ringPtr |s2 = for|
|00002860| 6d 61 74 2d 3e 6c 69 6e | 65 53 74 61 72 74 20 2b |mat->lin|eStart +|
|00002870| 20 31 3b 0d 09 09 77 68 | 69 6c 65 20 28 6c 65 6e | 1;...wh|ile (len|
|00002880| 32 2d 2d 20 3e 20 30 20 | 26 26 20 6c 65 6e 67 74 |2-- > 0 |&& lengt|
|00002890| 68 2d 2d 20 3e 20 30 29 | 0d 09 09 7b 0d 09 09 09 |h-- > 0)|...{....|
|000028a0| 69 66 20 28 2a 73 32 2b | 2b 20 21 3d 20 2a 73 2b |if (*s2+|+ != *s+|
|000028b0| 2b 29 0d 09 09 09 09 72 | 65 74 75 72 6e 20 66 61 |+).....r|eturn fa|
|000028c0| 6c 73 65 3b 0d 09 09 7d | 0d 09 7d 0d 09 0d 09 2f |lse;...}|..}..../|
|000028d0| 2a 20 73 6b 69 70 20 61 | 6e 79 20 6e 75 6d 62 65 |* skip a|ny numbe|
|000028e0| 72 20 6f 66 20 74 61 62 | 73 20 61 6e 64 20 73 70 |r of tab|s and sp|
|000028f0| 61 63 65 73 20 2a 2f 0d | 09 77 68 69 6c 65 20 28 |aces */.|.while (|
|00002900| 2a 73 20 3d 3d 20 27 5c | 74 27 20 7c 7c 20 2a 73 |*s == '\|t' || *s|
|00002910| 20 3d 3d 20 27 20 27 29 | 20 73 2b 2b 3b 0d 0d 09 | == ' ')| s++;...|
|00002920| 2f 2a 20 66 6f 75 6e 64 | 20 69 74 20 69 66 20 74 |/* found| it if t|
|00002930| 68 65 20 66 69 72 73 74 | 20 6e 6f 6e 2d 74 61 62 |he first| non-tab|
|00002940| 20 69 73 20 61 6e 20 61 | 6e 67 6c 65 20 62 72 61 | is an a|ngle bra|
|00002950| 63 6b 65 74 20 2a 2f 0d | 09 72 65 74 75 72 6e 20 |cket */.|.return |
|00002960| 28 2a 73 20 3d 3d 20 27 | 3c 27 29 3b 0d 7d 0d 0d |(*s == '|<');.}..|
|00002970| 0d 4f 53 45 72 72 20 46 | 69 6e 64 46 69 72 73 74 |.OSErr F|indFirst|
|00002980| 43 68 61 6e 67 65 43 6f | 6d 6d 65 6e 74 28 53 74 |ChangeCo|mment(St|
|00002990| 72 69 6e 67 48 61 6e 64 | 6c 65 20 68 65 61 64 65 |ringHand|le heade|
|000029a0| 72 2c 20 43 6f 6d 6d 65 | 6e 74 46 6f 72 6d 61 74 |r, Comme|ntFormat|
|000029b0| 20 2a 66 6f 72 6d 61 74 | 2c 0d 09 09 09 09 09 09 | *format|,.......|
|000029c0| 09 20 6c 6f 6e 67 20 2a | 73 74 61 72 74 2c 20 6c |. long *|start, l|
|000029d0| 6f 6e 67 20 2a 65 6e 64 | 29 0d 7b 0d 09 53 74 72 |ong *end|).{..Str|
|000029e0| 69 6e 67 50 74 72 20 68 | 65 61 64 65 72 4c 69 6e |ingPtr h|eaderLin|
|000029f0| 65 3b 0d 09 42 79 74 65 | 20 73 74 61 74 65 3b 0d |e;..Byte| state;.|
|00002a00| 09 6c 6f 6e 67 20 68 65 | 61 64 65 72 4c 69 6e 65 |.long he|aderLine|
|00002a10| 4c 65 6e 67 74 68 3b 0d | 09 6c 6f 6e 67 20 68 65 |Length;.|.long he|
|00002a20| 61 64 65 72 4c 65 6e 67 | 74 68 3b 0d 09 42 6f 6f |aderLeng|th;..Boo|
|00002a30| 6c 65 61 6e 20 66 6f 75 | 6e 64 20 3d 20 66 61 6c |lean fou|nd = fal|
|00002a40| 73 65 3b 0d 09 42 6f 6f | 6c 65 61 6e 20 6c 61 73 |se;..Boo|lean las|
|00002a50| 74 4c 69 6e 65 4d 61 74 | 63 68 65 64 43 6f 6d 6d |tLineMat|chedComm|
|00002a60| 65 6e 74 45 6e 64 3b 0d | 09 0d 09 73 74 61 74 65 |entEnd;.|...state|
|00002a70| 20 3d 20 48 47 65 74 53 | 74 61 74 65 28 68 65 61 | = HGetS|tate(hea|
|00002a80| 64 65 72 29 3b 0d 09 48 | 4c 6f 63 6b 28 68 65 61 |der);..H|Lock(hea|
|00002a90| 64 65 72 29 3b 0d 09 68 | 65 61 64 65 72 4c 69 6e |der);..h|eaderLin|
|00002aa0| 65 20 3d 20 2a 68 65 61 | 64 65 72 3b 0d 09 68 65 |e = *hea|der;..he|
|00002ab0| 61 64 65 72 4c 65 6e 67 | 74 68 20 3d 20 47 65 74 |aderLeng|th = Get|
|00002ac0| 48 61 6e 64 6c 65 53 69 | 7a 65 28 68 65 61 64 65 |HandleSi|ze(heade|
|00002ad0| 72 29 3b 0d 09 68 65 61 | 64 65 72 4c 69 6e 65 4c |r);..hea|derLineL|
|00002ae0| 65 6e 67 74 68 20 3d 20 | 4c 69 6e 65 53 69 7a 65 |ength = |LineSize|
|00002af0| 28 68 65 61 64 65 72 4c | 69 6e 65 2c 20 68 65 61 |(headerL|ine, hea|
|00002b00| 64 65 72 4c 65 6e 67 74 | 68 29 3b 0d 09 6c 61 73 |derLengt|h);..las|
|00002b10| 74 4c 69 6e 65 4d 61 74 | 63 68 65 64 43 6f 6d 6d |tLineMat|chedComm|
|00002b20| 65 6e 74 45 6e 64 20 3d | 20 66 61 6c 73 65 3b 0d |entEnd =| false;.|
|00002b30| 09 0d 09 2f 2a 20 6c 6f | 6f 70 20 6f 76 65 72 20 |.../* lo|op over |
|00002b40| 6c 69 6e 65 73 20 74 6f | 20 66 69 6e 64 20 66 69 |lines to| find fi|
|00002b50| 72 73 74 20 6c 69 6e 65 | 20 73 74 61 72 74 69 6e |rst line| startin|
|00002b60| 67 20 77 69 74 68 20 74 | 61 62 73 20 61 6e 64 20 |g with t|abs and |
|00002b70| 61 6e 67 6c 65 20 62 72 | 61 63 6b 65 74 20 2a 2f |angle br|acket */|
|00002b80| 0d 09 64 6f 0d 09 7b 0d | 09 09 2f 2a 20 63 68 65 |..do..{.|../* che|
|00002b90| 63 6b 20 66 6f 72 20 65 | 6e 64 20 6f 66 20 63 6f |ck for e|nd of co|
|00002ba0| 6d 6d 65 6e 74 20 2a 2f | 0d 09 09 69 66 20 28 6c |mment */|...if (l|
|00002bb0| 61 73 74 4c 69 6e 65 4d | 61 74 63 68 65 64 43 6f |astLineM|atchedCo|
|00002bc0| 6d 6d 65 6e 74 45 6e 64 | 20 26 26 20 68 65 61 64 |mmentEnd| && head|
|00002bd0| 65 72 4c 69 6e 65 4c 65 | 6e 67 74 68 20 3d 3d 20 |erLineLe|ngth == |
|00002be0| 31 20 26 26 20 2a 68 65 | 61 64 65 72 4c 69 6e 65 |1 && *he|aderLine|
|00002bf0| 20 3d 3d 20 27 5c 6e 27 | 29 0d 09 09 7b 0d 09 09 | == '\n'|)...{...|
|00002c00| 09 2f 2a 20 6e 6f 20 63 | 68 61 6e 67 65 20 63 6f |./* no c|hange co|
|00002c10| 6d 6d 65 6e 74 20 2a 2f | 0d 09 09 09 2a 73 74 61 |mment */|....*sta|
|00002c20| 72 74 20 3d 20 2a 65 6e | 64 20 3d 20 28 68 65 61 |rt = *en|d = (hea|
|00002c30| 64 65 72 4c 69 6e 65 20 | 2d 20 28 2a 68 65 61 64 |derLine |- (*head|
|00002c40| 65 72 29 29 20 2d 20 31 | 3b 0d 09 09 09 62 72 65 |er)) - 1|;....bre|
|00002c50| 61 6b 3b 0d 09 09 7d 0d | 09 09 0d 09 09 6c 61 73 |ak;...}.|.....las|
|00002c60| 74 4c 69 6e 65 4d 61 74 | 63 68 65 64 43 6f 6d 6d |tLineMat|chedComm|
|00002c70| 65 6e 74 45 6e 64 20 3d | 20 4d 61 74 63 68 4c 69 |entEnd =| MatchLi|
|00002c80| 6e 65 28 68 65 61 64 65 | 72 4c 69 6e 65 2c 20 68 |ne(heade|rLine, h|
|00002c90| 65 61 64 65 72 4c 69 6e | 65 4c 65 6e 67 74 68 2c |eaderLin|eLength,|
|00002ca0| 20 66 6f 72 6d 61 74 2d | 3e 63 6f 6d 6d 65 6e 74 | format-|>comment|
|00002cb0| 45 6e 64 20 2b 20 31 2c | 20 66 6f 72 6d 61 74 2d |End + 1,| format-|
|00002cc0| 3e 63 6f 6d 6d 65 6e 74 | 45 6e 64 5b 30 5d 29 3b |>comment|End[0]);|
|00002cd0| 0d 09 09 0d 09 09 66 6f | 75 6e 64 20 3d 20 49 73 |......fo|und = Is|
|00002ce0| 43 68 61 6e 67 65 43 6f | 6d 6d 65 6e 74 53 74 61 |ChangeCo|mmentSta|
|00002cf0| 72 74 4c 69 6e 65 28 68 | 65 61 64 65 72 4c 69 6e |rtLine(h|eaderLin|
|00002d00| 65 2c 20 68 65 61 64 65 | 72 4c 69 6e 65 4c 65 6e |e, heade|rLineLen|
|00002d10| 67 74 68 2c 20 66 6f 72 | 6d 61 74 29 3b 0d 09 09 |gth, for|mat);...|
|00002d20| 0d 09 09 69 66 20 28 21 | 66 6f 75 6e 64 29 0d 09 |...if (!|found)..|
|00002d30| 09 7b 0d 09 09 09 2f 2a | 20 69 66 20 6e 6f 74 20 |.{..../*| if not |
|00002d40| 66 6f 75 6e 64 2c 20 61 | 64 76 61 6e 63 65 20 74 |found, a|dvance t|
|00002d50| 6f 20 6e 65 78 74 20 6c | 69 6e 65 20 2a 2f 0d 09 |o next l|ine */..|
|00002d60| 09 09 68 65 61 64 65 72 | 4c 69 6e 65 20 2b 3d 20 |..header|Line += |
|00002d70| 68 65 61 64 65 72 4c 69 | 6e 65 4c 65 6e 67 74 68 |headerLi|neLength|
|00002d80| 3b 0d 09 09 09 68 65 61 | 64 65 72 4c 65 6e 67 74 |;....hea|derLengt|
|00002d90| 68 20 2d 3d 20 68 65 61 | 64 65 72 4c 69 6e 65 4c |h -= hea|derLineL|
|00002da0| 65 6e 67 74 68 3b 0d 09 | 09 09 68 65 61 64 65 72 |ength;..|..header|
|00002db0| 4c 69 6e 65 4c 65 6e 67 | 74 68 20 3d 20 4c 69 6e |LineLeng|th = Lin|
|00002dc0| 65 53 69 7a 65 28 68 65 | 61 64 65 72 4c 69 6e 65 |eSize(he|aderLine|
|00002dd0| 2c 20 68 65 61 64 65 72 | 4c 65 6e 67 74 68 29 3b |, header|Length);|
|00002de0| 0d 09 09 7d 0d 09 09 65 | 6c 73 65 0d 09 09 7b 0d |...}...e|lse...{.|
|00002df0| 09 09 09 2f 2a 20 69 66 | 20 66 6f 75 6e 64 2c 20 |.../* if| found, |
|00002e00| 72 65 63 6f 72 64 20 74 | 68 65 20 73 74 61 72 74 |record t|he start|
|00002e10| 20 6f 66 20 74 68 65 20 | 63 6f 6d 6d 65 6e 74 20 | of the |comment |
|00002e20| 61 6e 64 20 73 63 61 6e | 20 66 6f 72 20 74 68 65 |and scan| for the|
|00002e30| 20 6e 65 78 74 20 6f 72 | 20 74 68 65 20 65 6e 64 | next or| the end|
|00002e40| 20 2a 2f 0d 09 09 09 2a | 73 74 61 72 74 20 3d 20 | */....*|start = |
|00002e50| 68 65 61 64 65 72 4c 69 | 6e 65 20 2d 20 2a 68 65 |headerLi|ne - *he|
|00002e60| 61 64 65 72 3b 0d 09 09 | 09 0d 09 09 09 68 65 61 |ader;...|.....hea|
|00002e70| 64 65 72 4c 69 6e 65 20 | 2b 3d 20 68 65 61 64 65 |derLine |+= heade|
|00002e80| 72 4c 69 6e 65 4c 65 6e | 67 74 68 3b 0d 09 09 09 |rLineLen|gth;....|
|00002e90| 68 65 61 64 65 72 4c 65 | 6e 67 74 68 20 2d 3d 20 |headerLe|ngth -= |
|00002ea0| 68 65 61 64 65 72 4c 69 | 6e 65 4c 65 6e 67 74 68 |headerLi|neLength|
|00002eb0| 3b 0d 09 09 09 68 65 61 | 64 65 72 4c 69 6e 65 4c |;....hea|derLineL|
|00002ec0| 65 6e 67 74 68 20 3d 20 | 4c 69 6e 65 53 69 7a 65 |ength = |LineSize|
|00002ed0| 28 68 65 61 64 65 72 4c | 69 6e 65 2c 20 68 65 61 |(headerL|ine, hea|
|00002ee0| 64 65 72 4c 65 6e 67 74 | 68 29 3b 0d 09 09 09 6c |derLengt|h);....l|
|00002ef0| 61 73 74 4c 69 6e 65 4d | 61 74 63 68 65 64 43 6f |astLineM|atchedCo|
|00002f00| 6d 6d 65 6e 74 45 6e 64 | 20 3d 20 66 61 6c 73 65 |mmentEnd| = false|
|00002f10| 3b 0d 09 09 09 64 6f 0d | 09 09 09 7b 0d 09 09 09 |;....do.|...{....|
|00002f20| 09 69 66 20 28 4d 61 74 | 63 68 4c 69 6e 65 28 68 |.if (Mat|chLine(h|
|00002f30| 65 61 64 65 72 4c 69 6e | 65 2c 20 68 65 61 64 65 |eaderLin|e, heade|
|00002f40| 72 4c 69 6e 65 4c 65 6e | 67 74 68 2c 20 66 6f 72 |rLineLen|gth, for|
|00002f50| 6d 61 74 2d 3e 63 6f 6d | 6d 65 6e 74 45 6e 64 20 |mat->com|mentEnd |
|00002f60| 2b 20 31 2c 20 66 6f 72 | 6d 61 74 2d 3e 63 6f 6d |+ 1, for|mat->com|
|00002f70| 6d 65 6e 74 45 6e 64 5b | 30 5d 29 29 0d 09 09 09 |mentEnd[|0]))....|
|00002f80| 09 09 62 72 65 61 6b 3b | 20 2f 2a 20 61 64 64 69 |..break;| /* addi|
|00002f90| 6e 67 20 74 68 65 20 66 | 69 72 73 74 20 63 68 61 |ng the f|irst cha|
|00002fa0| 6e 67 65 20 63 6f 6d 6d | 65 6e 74 20 2a 2f 0d 09 |nge comm|ent */..|
|00002fb0| 09 09 09 0d 09 09 09 09 | 69 66 20 28 49 73 43 68 |........|if (IsCh|
|00002fc0| 61 6e 67 65 43 6f 6d 6d | 65 6e 74 53 74 61 72 74 |angeComm|entStart|
|00002fd0| 4c 69 6e 65 28 68 65 61 | 64 65 72 4c 69 6e 65 2c |Line(hea|derLine,|
|00002fe0| 20 68 65 61 64 65 72 4c | 69 6e 65 4c 65 6e 67 74 | headerL|ineLengt|
|00002ff0| 68 2c 20 66 6f 72 6d 61 | 74 29 29 0d 09 09 09 09 |h, forma|t)).....|
|00003000| 09 62 72 65 61 6b 3b 20 | 2f 2a 20 66 6f 75 6e 64 |.break; |/* found|
|00003010| 20 73 74 61 72 74 20 6f | 66 20 6e 65 78 74 20 63 | start o|f next c|
|00003020| 68 61 6e 67 65 20 63 6f | 6d 6d 65 6e 74 20 2a 2f |hange co|mment */|
|00003030| 0d 09 09 09 09 0d 09 09 | 09 09 2f 2a 20 74 72 79 |........|../* try|
|00003040| 20 74 68 65 20 6e 65 78 | 74 20 6c 69 6e 65 20 2a | the nex|t line *|
|00003050| 2f 0d 09 09 09 09 68 65 | 61 64 65 72 4c 69 6e 65 |/.....he|aderLine|
|00003060| 20 2b 3d 20 68 65 61 64 | 65 72 4c 69 6e 65 4c 65 | += head|erLineLe|
|00003070| 6e 67 74 68 3b 0d 09 09 | 09 09 68 65 61 64 65 72 |ngth;...|..header|
|00003080| 4c 65 6e 67 74 68 20 2d | 3d 20 68 65 61 64 65 72 |Length -|= header|
|00003090| 4c 69 6e 65 4c 65 6e 67 | 74 68 3b 0d 09 09 09 09 |LineLeng|th;.....|
|000030a0| 68 65 61 64 65 72 4c 69 | 6e 65 4c 65 6e 67 74 68 |headerLi|neLength|
|000030b0| 20 3d 20 4c 69 6e 65 53 | 69 7a 65 28 68 65 61 64 | = LineS|ize(head|
|000030c0| 65 72 4c 69 6e 65 2c 20 | 68 65 61 64 65 72 4c 65 |erLine, |headerLe|
|000030d0| 6e 67 74 68 29 3b 0d 09 | 09 09 7d 20 77 68 69 6c |ngth);..|..} whil|
|000030e0| 65 20 28 68 65 61 64 65 | 72 4c 65 6e 67 74 68 20 |e (heade|rLength |
|000030f0| 3e 20 30 29 3b 0d 09 09 | 09 0d 09 09 09 2a 65 6e |> 0);...|.....*en|
|00003100| 64 20 3d 20 28 68 65 61 | 64 65 72 4c 69 6e 65 20 |d = (hea|derLine |
|00003110| 2d 20 28 2a 68 65 61 64 | 65 72 29 29 20 2d 20 31 |- (*head|er)) - 1|
|00003120| 3b 0d 09 09 7d 0d 09 7d | 20 77 68 69 6c 65 20 28 |;...}..}| while (|
|00003130| 68 65 61 64 65 72 4c 65 | 6e 67 74 68 20 3e 20 30 |headerLe|ngth > 0|
|00003140| 20 26 26 20 21 66 6f 75 | 6e 64 29 3b 0d 09 0d 09 | && !fou|nd);....|
|00003150| 48 53 65 74 53 74 61 74 | 65 28 68 65 61 64 65 72 |HSetStat|e(header|
|00003160| 2c 20 73 74 61 74 65 29 | 3b 0d 09 0d 09 72 65 74 |, state)|;....ret|
|00003170| 75 72 6e 20 6e 6f 45 72 | 72 3b 0d 7d 0d 0d 0d 4f |urn noEr|r;.}...O|
|00003180| 53 45 72 72 20 47 65 74 | 52 65 76 69 73 69 6f 6e |SErr Get|Revision|
|00003190| 4e 75 6d 62 65 72 28 46 | 53 53 70 65 63 20 2a 66 |Number(F|SSpec *f|
|000031a0| 69 6c 65 2c 20 73 68 6f | 72 74 20 2a 72 65 76 69 |ile, sho|rt *revi|
|000031b0| 73 69 6f 6e 29 0d 7b 0d | 09 43 4b 49 44 48 61 6e |sion).{.|.CKIDHan|
|000031c0| 64 6c 65 20 74 68 65 43 | 4b 49 44 3b 0d 09 4f 53 |dle theC|KID;..OS|
|000031d0| 45 72 72 20 65 72 72 3b | 0d 09 0d 09 2f 2a 20 67 |Err err;|..../* g|
|000031e0| 65 74 20 74 68 65 20 43 | 4b 49 44 20 2a 2f 0d 09 |et the C|KID */..|
|000031f0| 65 72 72 20 3d 20 45 78 | 74 72 61 63 74 43 4b 49 |err = Ex|tractCKI|
|00003200| 44 28 66 69 6c 65 2c 20 | 26 74 68 65 43 4b 49 44 |D(file, |&theCKID|
|00003210| 29 3b 0d 09 0d 09 69 66 | 20 28 65 72 72 20 21 3d |);....if| (err !=|
|00003220| 20 6e 6f 45 72 72 29 0d | 09 7b 0d 09 09 2f 2a 20 | noErr).|.{.../* |
|00003230| 69 66 20 6e 6f 20 43 4b | 49 44 2c 20 69 74 27 73 |if no CK|ID, it's|
|00003240| 20 72 65 76 69 73 69 6f | 6e 20 30 21 20 2a 2f 0d | revisio|n 0! */.|
|00003250| 09 09 2a 72 65 76 69 73 | 69 6f 6e 20 3d 20 30 3b |..*revis|ion = 0;|
|00003260| 0d 09 7d 0d 09 65 6c 73 | 65 0d 09 7b 0d 09 09 2f |..}..els|e..{.../|
|00003270| 2a 20 6f 74 68 65 72 77 | 69 73 65 20 69 74 27 73 |* otherw|ise it's|
|00003280| 20 74 68 65 20 6e 75 6d | 62 65 72 20 69 6e 20 74 | the num|ber in t|
|00003290| 68 65 20 43 4b 49 44 20 | 2a 2f 0d 09 09 53 74 72 |he CKID |*/...Str|
|000032a0| 33 31 20 72 65 76 69 73 | 69 6f 6e 53 74 72 69 6e |31 revis|ionStrin|
|000032b0| 67 3b 0d 09 09 6c 6f 6e | 67 20 6c 6f 6e 67 52 65 |g;...lon|g longRe|
|000032c0| 76 69 73 69 6f 6e 3b 0d | 09 09 53 74 72 69 6e 67 |vision;.|..String|
|000032d0| 50 74 72 20 73 20 3d 20 | 28 2a 74 68 65 43 4b 49 |Ptr s = |(*theCKI|
|000032e0| 44 29 2d 3e 70 72 6f 6a | 65 63 74 50 61 74 68 3b |D)->proj|ectPath;|
|000032f0| 20 2f 2a 20 63 61 72 65 | 66 75 6c 20 2d 2d 20 6e | /* care|ful -- n|
|00003300| 6f 74 20 6c 6f 63 6b 65 | 64 20 64 6f 77 6e 20 2a |ot locke|d down *|
|00003310| 2f 0d 09 09 73 20 2b 3d | 20 73 5b 30 5d 20 2b 20 |/...s +=| s[0] + |
|00003320| 32 3b 09 09 2f 2a 20 73 | 6b 69 70 20 74 68 65 20 |2;../* s|kip the |
|00003330| 70 72 6f 6a 65 63 74 20 | 6e 61 6d 65 20 61 6e 64 |project |name and|
|00003340| 20 6e 75 6c 6c 20 63 68 | 61 72 61 63 74 65 72 20 | null ch|aracter |
|00003350| 2a 2f 0d 09 09 73 20 2b | 3d 20 73 5b 30 5d 20 2b |*/...s +|= s[0] +|
|00003360| 20 32 3b 09 09 2f 2a 20 | 73 6b 69 70 20 74 68 65 | 2;../* |skip the|
|00003370| 20 75 73 65 72 20 6e 61 | 6d 65 20 61 6e 64 20 6e | user na|me and n|
|00003380| 75 6c 6c 20 63 68 61 72 | 61 63 74 65 72 20 2a 2f |ull char|acter */|
|00003390| 0d 09 09 42 6c 6f 63 6b | 4d 6f 76 65 44 61 74 61 |...Block|MoveData|
|000033a0| 28 73 2c 20 72 65 76 69 | 73 69 6f 6e 53 74 72 69 |(s, revi|sionStri|
|000033b0| 6e 67 2c 20 73 5b 30 5d | 20 2b 20 31 29 3b 20 2f |ng, s[0]| + 1); /|
|000033c0| 2a 20 63 6f 70 79 20 74 | 68 65 20 72 65 76 69 73 |* copy t|he revis|
|000033d0| 69 6f 6e 20 6e 75 6d 62 | 65 72 20 2a 2f 0d 09 09 |ion numb|er */...|
|000033e0| 53 74 72 69 6e 67 54 6f | 4e 75 6d 28 72 65 76 69 |StringTo|Num(revi|
|000033f0| 73 69 6f 6e 53 74 72 69 | 6e 67 2c 20 26 6c 6f 6e |sionStri|ng, &lon|
|00003400| 67 52 65 76 69 73 69 6f | 6e 29 3b 0d 09 09 2a 72 |gRevisio|n);...*r|
|00003410| 65 76 69 73 69 6f 6e 20 | 3d 20 28 73 68 6f 72 74 |evision |= (short|
|00003420| 29 6c 6f 6e 67 52 65 76 | 69 73 69 6f 6e 3b 0d 09 |)longRev|ision;..|
|00003430| 09 44 69 73 70 6f 73 65 | 48 61 6e 64 6c 65 28 28 |.Dispose|Handle((|
|00003440| 48 61 6e 64 6c 65 29 74 | 68 65 43 4b 49 44 29 3b |Handle)t|heCKID);|
|00003450| 0d 09 7d 0d 09 72 65 74 | 75 72 6e 20 6e 6f 45 72 |..}..ret|urn noEr|
|00003460| 72 3b 0d 7d 0d 0d 0d 4f | 53 45 72 72 20 42 75 69 |r;.}...O|SErr Bui|
|00003470| 6c 64 43 6f 6d 6d 65 6e | 74 28 48 61 6e 64 6c 65 |ldCommen|t(Handle|
|00003480| 20 2a 63 6f 6d 6d 65 6e | 74 48 61 6e 64 6c 65 2c | *commen|tHandle,|
|00003490| 20 43 6f 6d 6d 65 6e 74 | 46 6f 72 6d 61 74 20 2a | Comment|Format *|
|000034a0| 66 6f 72 6d 61 74 2c 20 | 73 68 6f 72 74 20 72 65 |format, |short re|
|000034b0| 76 69 73 69 6f 6e 2c 0d | 09 09 09 09 09 42 6f 6f |vision,.|.....Boo|
|000034c0| 6c 65 61 6e 20 63 68 65 | 63 6b 69 6e 67 4f 75 74 |lean che|ckingOut|
|000034d0| 2c 20 53 74 72 69 6e 67 | 50 74 72 20 63 6f 6d 6d |, String|Ptr comm|
|000034e0| 65 6e 74 2c 20 53 74 72 | 69 6e 67 50 74 72 20 6e |ent, Str|ingPtr n|
|000034f0| 69 63 6b 6e 61 6d 65 29 | 0d 7b 0d 09 4f 53 45 72 |ickname)|.{..OSEr|
|00003500| 72 20 65 72 72 3b 0d 09 | 53 74 72 33 31 20 72 65 |r err;..|Str31 re|
|00003510| 76 69 73 69 6f 6e 53 74 | 72 69 6e 67 3b 0d 09 75 |visionSt|ring;..u|
|00003520| 6e 73 69 67 6e 65 64 20 | 6c 6f 6e 67 20 73 65 63 |nsigned |long sec|
|00003530| 74 73 3b 0d 09 53 74 72 | 33 31 20 64 61 74 65 53 |ts;..Str|31 dateS|
|00003540| 74 72 69 6e 67 3b 0d 09 | 63 68 61 72 20 63 3b 0d |tring;..|char c;.|
|00003550| 09 0d 09 2f 2a 20 42 75 | 69 6c 64 20 74 68 65 20 |.../* Bu|ild the |
|00003560| 63 68 61 6e 67 65 20 63 | 6f 6d 6d 65 6e 74 2c 20 |change c|omment, |
|00003570| 61 6c 69 67 6e 65 64 20 | 74 6f 20 66 6f 75 72 2d |aligned |to four-|
|00003580| 63 6f 6c 75 6d 6e 20 66 | 6f 72 6d 61 74 2e 0d 09 |column f|ormat...|
|00003590| 20 2a 20 54 68 65 20 65 | 6e 64 20 6f 66 20 74 68 | * The e|nd of th|
|000035a0| 65 20 72 65 76 69 73 69 | 6f 6e 20 6e 75 6d 62 65 |e revisi|on numbe|
|000035b0| 72 20 28 22 3e 22 29 20 | 66 61 6c 6c 73 20 6f 6e |r (">") |falls on|
|000035c0| 20 63 6f 6c 75 6d 6e 20 | 74 77 65 6c 76 65 20 28 | column |twelve (|
|000035d0| 31 32 29 3b 0d 09 20 2a | 20 74 68 65 20 65 6e 64 |12);.. *| the end|
|000035e0| 20 6f 66 20 74 68 65 20 | 64 61 74 65 20 6f 6e 20 | of the |date on |
|000035f0| 63 6f 6c 75 6d 6e 20 74 | 77 65 6e 74 79 2d 66 6f |column t|wenty-fo|
|00003600| 75 72 20 28 32 34 29 3b | 0d 09 20 2a 20 74 68 65 |ur (24);|.. * the|
|00003610| 20 73 74 61 72 74 20 6f | 66 20 74 68 65 20 69 6e | start o|f the in|
|00003620| 69 74 69 61 6c 73 20 6f | 6e 20 63 6f 6c 75 6d 6e |itials o|n column|
|00003630| 20 74 77 65 6e 74 79 2d | 6e 69 6e 65 20 28 32 39 | twenty-|nine (29|
|00003640| 29 3b 0d 09 20 2a 20 74 | 68 65 20 73 74 61 72 74 |);.. * t|he start|
|00003650| 20 6f 66 20 74 68 65 20 | 63 6f 6d 6d 65 6e 74 20 | of the |comment |
|00003660| 6f 6e 20 63 6f 6c 75 6d | 6e 20 74 68 69 72 74 79 |on colum|n thirty|
|00003670| 2d 73 65 76 65 6e 20 28 | 33 37 29 2e 0d 09 20 2a |-seven (|37)... *|
|00003680| 2f 0d 09 65 72 72 20 3d | 20 50 74 72 54 6f 48 61 |/..err =| PtrToHa|
|00003690| 6e 64 28 66 6f 72 6d 61 | 74 2d 3e 6c 69 6e 65 53 |nd(forma|t->lineS|
|000036a0| 74 61 72 74 20 2b 20 31 | 2c 20 63 6f 6d 6d 65 6e |tart + 1|, commen|
|000036b0| 74 48 61 6e 64 6c 65 2c | 20 66 6f 72 6d 61 74 2d |tHandle,| format-|
|000036c0| 3e 6c 69 6e 65 53 74 61 | 72 74 5b 30 5d 29 3b 0d |>lineSta|rt[0]);.|
|000036d0| 09 69 66 20 28 65 72 72 | 20 21 3d 20 6e 6f 45 72 |.if (err| != noEr|
|000036e0| 72 29 20 67 6f 74 6f 20 | 45 72 72 6f 72 45 78 69 |r) goto |ErrorExi|
|000036f0| 74 3b 0d 09 0d 09 2f 2a | 20 61 64 64 20 74 68 65 |t;..../*| add the|
|00003700| 20 72 65 76 69 73 69 6f | 6e 20 73 74 72 69 6e 67 | revisio|n string|
|00003710| 20 2a 2f 0d 09 4e 75 6d | 54 6f 53 74 72 69 6e 67 | */..Num|ToString|
|00003720| 28 63 68 65 63 6b 69 6e | 67 4f 75 74 20 3f 20 72 |(checkin|gOut ? r|
|00003730| 65 76 69 73 69 6f 6e 20 | 3a 20 72 65 76 69 73 69 |evision |: revisi|
|00003740| 6f 6e 20 2b 20 31 2c 20 | 72 65 76 69 73 69 6f 6e |on + 1, |revision|
|00003750| 53 74 72 69 6e 67 29 3b | 0d 09 69 66 20 28 63 68 |String);|..if (ch|
|00003760| 65 63 6b 69 6e 67 4f 75 | 74 29 20 72 65 76 69 73 |eckingOu|t) revis|
|00003770| 69 6f 6e 53 74 72 69 6e | 67 5b 2b 2b 72 65 76 69 |ionStrin|g[++revi|
|00003780| 73 69 6f 6e 53 74 72 69 | 6e 67 5b 30 5d 5d 20 3d |sionStri|ng[0]] =|
|00003790| 20 27 2b 27 3b 0d 09 65 | 72 72 20 3d 20 50 61 64 | '+';..e|rr = Pad|
|000037a0| 54 6f 43 6f 6c 75 6d 6e | 28 2a 63 6f 6d 6d 65 6e |ToColumn|(*commen|
|000037b0| 74 48 61 6e 64 6c 65 2c | 20 31 32 20 2d 20 28 72 |tHandle,| 12 - (r|
|000037c0| 65 76 69 73 69 6f 6e 53 | 74 72 69 6e 67 5b 30 5d |evisionS|tring[0]|
|000037d0| 20 2b 20 32 29 29 3b 0d | 09 69 66 20 28 65 72 72 | + 2));.|.if (err|
|000037e0| 20 21 3d 20 6e 6f 45 72 | 72 29 20 67 6f 74 6f 20 | != noEr|r) goto |
|000037f0| 45 72 72 6f 72 45 78 69 | 74 3b 0d 09 63 20 3d 20 |ErrorExi|t;..c = |
|00003800| 27 3c 27 3b 0d 09 65 72 | 72 20 3d 20 50 74 72 41 |'<';..er|r = PtrA|
|00003810| 6e 64 48 61 6e 64 28 26 | 63 2c 20 2a 63 6f 6d 6d |ndHand(&|c, *comm|
|00003820| 65 6e 74 48 61 6e 64 6c | 65 2c 20 31 29 3b 0d 09 |entHandl|e, 1);..|
|00003830| 69 66 20 28 65 72 72 20 | 21 3d 20 6e 6f 45 72 72 |if (err |!= noErr|
|00003840| 29 20 67 6f 74 6f 20 45 | 72 72 6f 72 45 78 69 74 |) goto E|rrorExit|
|00003850| 3b 0d 09 65 72 72 20 3d | 20 50 74 72 41 6e 64 48 |;..err =| PtrAndH|
|00003860| 61 6e 64 28 72 65 76 69 | 73 69 6f 6e 53 74 72 69 |and(revi|sionStri|
|00003870| 6e 67 20 2b 20 31 2c 20 | 2a 63 6f 6d 6d 65 6e 74 |ng + 1, |*comment|
|00003880| 48 61 6e 64 6c 65 2c 20 | 72 65 76 69 73 69 6f 6e |Handle, |revision|
|00003890| 53 74 72 69 6e 67 5b 30 | 5d 29 3b 0d 09 69 66 20 |String[0|]);..if |
|000038a0| 28 65 72 72 20 21 3d 20 | 6e 6f 45 72 72 29 20 67 |(err != |noErr) g|
|000038b0| 6f 74 6f 20 45 72 72 6f | 72 45 78 69 74 3b 0d 09 |oto Erro|rExit;..|
|000038c0| 63 20 3d 20 27 3e 27 3b | 0d 09 65 72 72 20 3d 20 |c = '>';|..err = |
|000038d0| 50 74 72 41 6e 64 48 61 | 6e 64 28 26 63 2c 20 2a |PtrAndHa|nd(&c, *|
|000038e0| 63 6f 6d 6d 65 6e 74 48 | 61 6e 64 6c 65 2c 20 31 |commentH|andle, 1|
|000038f0| 29 3b 0d 09 69 66 20 28 | 65 72 72 20 21 3d 20 6e |);..if (|err != n|
|00003900| 6f 45 72 72 29 20 67 6f | 74 6f 20 45 72 72 6f 72 |oErr) go|to Error|
|00003910| 45 78 69 74 3b 0d 09 0d | 09 2f 2a 20 61 64 64 20 |Exit;...|./* add |
|00003920| 74 68 65 20 64 61 74 65 | 20 73 74 72 69 6e 67 20 |the date| string |
|00003930| 2a 2f 0d 09 47 65 74 44 | 61 74 65 54 69 6d 65 28 |*/..GetD|ateTime(|
|00003940| 26 73 65 63 74 73 29 3b | 0d 09 44 61 74 65 53 74 |§s);|..DateSt|
|00003950| 72 69 6e 67 28 73 65 63 | 74 73 2c 20 73 68 6f 72 |ring(sec|ts, shor|
|00003960| 74 44 61 74 65 2c 20 64 | 61 74 65 53 74 72 69 6e |tDate, d|ateStrin|
|00003970| 67 2c 20 4e 55 4c 4c 29 | 3b 0d 09 65 72 72 20 3d |g, NULL)|;..err =|
|00003980| 20 50 61 64 54 6f 43 6f | 6c 75 6d 6e 28 2a 63 6f | PadToCo|lumn(*co|
|00003990| 6d 6d 65 6e 74 48 61 6e | 64 6c 65 2c 20 32 34 20 |mmentHan|dle, 24 |
|000039a0| 2d 20 64 61 74 65 53 74 | 72 69 6e 67 5b 30 5d 29 |- dateSt|ring[0])|
|000039b0| 3b 0d 09 69 66 20 28 65 | 72 72 20 21 3d 20 6e 6f |;..if (e|rr != no|
|000039c0| 45 72 72 29 20 67 6f 74 | 6f 20 45 72 72 6f 72 45 |Err) got|o ErrorE|
|000039d0| 78 69 74 3b 0d 09 65 72 | 72 20 3d 20 50 74 72 41 |xit;..er|r = PtrA|
|000039e0| 6e 64 48 61 6e 64 28 64 | 61 74 65 53 74 72 69 6e |ndHand(d|ateStrin|
|000039f0| 67 20 2b 20 31 2c 20 2a | 63 6f 6d 6d 65 6e 74 48 |g + 1, *|commentH|
|00003a00| 61 6e 64 6c 65 2c 20 64 | 61 74 65 53 74 72 69 6e |andle, d|ateStrin|
|00003a10| 67 5b 30 5d 29 3b 0d 09 | 69 66 20 28 65 72 72 20 |g[0]);..|if (err |
|00003a20| 21 3d 20 6e 6f 45 72 72 | 29 20 67 6f 74 6f 20 45 |!= noErr|) goto E|
|00003a30| 72 72 6f 72 45 78 69 74 | 3b 0d 09 0d 09 2f 2a 20 |rrorExit|;..../* |
|00003a40| 61 64 64 20 74 68 65 20 | 6e 69 63 6b 6e 61 6d 65 |add the |nickname|
|00003a50| 20 2a 2f 0d 09 65 72 72 | 20 3d 20 50 61 64 54 6f | */..err| = PadTo|
|00003a60| 43 6f 6c 75 6d 6e 28 2a | 63 6f 6d 6d 65 6e 74 48 |Column(*|commentH|
|00003a70| 61 6e 64 6c 65 2c 20 32 | 38 29 3b 0d 09 69 66 20 |andle, 2|8);..if |
|00003a80| 28 65 72 72 20 21 3d 20 | 6e 6f 45 72 72 29 20 67 |(err != |noErr) g|
|00003a90| 6f 74 6f 20 45 72 72 6f | 72 45 78 69 74 3b 0d 09 |oto Erro|rExit;..|
|00003aa0| 65 72 72 20 3d 20 50 74 | 72 41 6e 64 48 61 6e 64 |err = Pt|rAndHand|
|00003ab0| 28 6e 69 63 6b 6e 61 6d | 65 20 2b 20 31 2c 20 2a |(nicknam|e + 1, *|
|00003ac0| 63 6f 6d 6d 65 6e 74 48 | 61 6e 64 6c 65 2c 20 6e |commentH|andle, n|
|00003ad0| 69 63 6b 6e 61 6d 65 5b | 30 5d 29 3b 0d 09 69 66 |ickname[|0]);..if|
|00003ae0| 20 28 65 72 72 20 21 3d | 20 6e 6f 45 72 72 29 20 | (err !=| noErr) |
|00003af0| 67 6f 74 6f 20 45 72 72 | 6f 72 45 78 69 74 3b 0d |goto Err|orExit;.|
|00003b00| 09 0d 09 2f 2a 20 61 64 | 64 20 74 68 65 20 63 6f |.../* ad|d the co|
|00003b10| 6d 6d 65 6e 74 2c 20 73 | 70 6c 69 74 74 69 6e 67 |mment, s|plitting|
|00003b20| 20 61 6d 6f 6e 67 20 6d | 75 6c 74 69 70 6c 65 20 | among m|ultiple |
|00003b30| 6c 69 6e 65 73 20 69 66 | 20 6e 65 63 65 73 73 61 |lines if| necessa|
|00003b40| 72 79 3b 0d 09 20 2a 20 | 6d 61 78 20 6c 69 6e 65 |ry;.. * |max line|
|00003b50| 20 6c 65 6e 67 74 68 20 | 69 73 20 31 30 30 2c 20 | length |is 100, |
|00003b60| 73 6f 20 74 68 65 20 6d | 61 78 20 73 69 7a 65 20 |so the m|ax size |
|00003b70| 6f 66 20 61 20 73 65 63 | 74 69 6f 6e 20 69 73 20 |of a sec|tion is |
|00003b80| 31 30 30 2d 33 37 20 3d | 20 36 33 0d 09 20 2a 2f |100-37 =| 63.. */|
|00003b90| 0d 09 65 72 72 20 3d 20 | 50 61 64 54 6f 43 6f 6c |..err = |PadToCol|
|00003ba0| 75 6d 6e 28 2a 63 6f 6d | 6d 65 6e 74 48 61 6e 64 |umn(*com|mentHand|
|00003bb0| 6c 65 2c 20 33 36 29 3b | 0d 09 69 66 20 28 65 72 |le, 36);|..if (er|
|00003bc0| 72 20 21 3d 20 6e 6f 45 | 72 72 29 20 67 6f 74 6f |r != noE|rr) goto|
|00003bd0| 20 45 72 72 6f 72 45 78 | 69 74 3b 0d 09 69 66 20 | ErrorEx|it;..if |
|00003be0| 28 63 6f 6d 6d 65 6e 74 | 5b 30 5d 20 3c 3d 20 36 |(comment|[0] <= 6|
|00003bf0| 33 29 0d 09 7b 0d 09 09 | 65 72 72 20 3d 20 50 74 |3)..{...|err = Pt|
|00003c00| 72 41 6e 64 48 61 6e 64 | 28 63 6f 6d 6d 65 6e 74 |rAndHand|(comment|
|00003c10| 20 2b 20 31 2c 20 2a 63 | 6f 6d 6d 65 6e 74 48 61 | + 1, *c|ommentHa|
|00003c20| 6e 64 6c 65 2c 20 63 6f | 6d 6d 65 6e 74 5b 30 5d |ndle, co|mment[0]|
|00003c30| 29 3b 0d 09 09 69 66 20 | 28 65 72 72 20 21 3d 20 |);...if |(err != |
|00003c40| 6e 6f 45 72 72 29 20 67 | 6f 74 6f 20 45 72 72 6f |noErr) g|oto Erro|
|00003c50| 72 45 78 69 74 3b 0d 09 | 7d 0d 09 65 6c 73 65 0d |rExit;..|}..else.|
|00003c60| 09 7b 0d 09 09 2f 2a 20 | 73 70 6c 69 74 20 74 68 |.{.../* |split th|
|00003c70| 61 74 20 73 75 63 6b 65 | 72 20 2a 2f 0d 09 09 53 |at sucke|r */...S|
|00003c80| 74 72 69 6e 67 50 74 72 | 20 73 74 72 53 74 61 72 |tringPtr| strStar|
|00003c90| 74 20 3d 20 63 6f 6d 6d | 65 6e 74 20 2b 20 31 3b |t = comm|ent + 1;|
|00003ca0| 0d 09 09 6c 6f 6e 67 20 | 73 74 72 4c 65 6e 20 3d |...long |strLen =|
|00003cb0| 20 63 6f 6d 6d 65 6e 74 | 5b 30 5d 3b 0d 09 09 77 | comment|[0];...w|
|00003cc0| 68 69 6c 65 20 28 73 74 | 72 4c 65 6e 20 3e 20 30 |hile (st|rLen > 0|
|00003cd0| 29 0d 09 09 7b 0d 09 09 | 09 53 74 72 69 6e 67 50 |)...{...|.StringP|
|00003ce0| 74 72 20 73 74 72 45 6e | 64 3b 0d 09 09 09 69 66 |tr strEn|d;....if|
|00003cf0| 20 28 73 74 72 4c 65 6e | 20 3e 20 36 33 29 0d 09 | (strLen| > 63)..|
|00003d00| 09 09 7b 0d 09 09 09 09 | 73 74 72 45 6e 64 20 3d |..{.....|strEnd =|
|00003d10| 20 73 74 72 53 74 61 72 | 74 20 2b 20 36 33 3b 0d | strStar|t + 63;.|
|00003d20| 09 09 09 09 77 68 69 6c | 65 20 28 73 74 72 45 6e |....whil|e (strEn|
|00003d30| 64 5b 30 5d 20 21 3d 20 | 27 20 27 20 26 26 20 73 |d[0] != |' ' && s|
|00003d40| 74 72 45 6e 64 5b 30 5d | 20 21 3d 20 27 5c 74 27 |trEnd[0]| != '\t'|
|00003d50| 20 26 26 20 73 74 72 45 | 6e 64 20 3e 20 73 74 72 | && strE|nd > str|
|00003d60| 53 74 61 72 74 29 0d 09 | 09 09 09 09 73 74 72 45 |Start)..|....strE|
|00003d70| 6e 64 2d 2d 3b 0d 09 09 | 09 09 69 66 20 28 73 74 |nd--;...|..if (st|
|00003d80| 72 53 74 61 72 74 20 3d | 3d 20 73 74 72 45 6e 64 |rStart =|= strEnd|
|00003d90| 29 0d 09 09 09 09 7b 0d | 09 09 09 09 09 2f 2a 20 |).....{.|...../* |
|00003da0| 74 68 65 72 65 20 77 65 | 72 65 20 6e 6f 20 73 70 |there we|re no sp|
|00003db0| 61 63 65 73 20 2d 2d 20 | 73 70 6c 69 74 20 61 72 |aces -- |split ar|
|00003dc0| 62 69 74 72 61 72 69 6c | 79 20 61 74 20 36 33 2e |bitraril|y at 63.|
|00003dd0| 2e 2e 20 2a 2f 0d 09 09 | 09 09 09 73 74 72 45 6e |.. */...|...strEn|
|00003de0| 64 20 3d 20 73 74 72 53 | 74 61 72 74 20 2b 20 36 |d = strS|tart + 6|
|00003df0| 33 3b 0d 09 09 09 09 7d | 0d 09 09 09 7d 0d 09 09 |3;.....}|....}...|
|00003e00| 09 65 6c 73 65 0d 09 09 | 09 7b 0d 09 09 09 09 73 |.else...|.{.....s|
|00003e10| 74 72 45 6e 64 20 3d 20 | 73 74 72 53 74 61 72 74 |trEnd = |strStart|
|00003e20| 20 2b 20 73 74 72 4c 65 | 6e 3b 0d 09 09 09 7d 0d | + strLe|n;....}.|
|00003e30| 09 09 09 0d 09 09 09 2f | 2a 20 61 64 64 20 74 68 |......./|* add th|
|00003e40| 69 73 20 63 68 75 6e 6b | 20 2a 2f 0d 09 09 09 65 |is chunk| */....e|
|00003e50| 72 72 20 3d 20 50 74 72 | 41 6e 64 48 61 6e 64 28 |rr = Ptr|AndHand(|
|00003e60| 73 74 72 53 74 61 72 74 | 2c 20 2a 63 6f 6d 6d 65 |strStart|, *comme|
|00003e70| 6e 74 48 61 6e 64 6c 65 | 2c 20 73 74 72 45 6e 64 |ntHandle|, strEnd|
|00003e80| 20 2d 20 73 74 72 53 74 | 61 72 74 29 3b 0d 09 09 | - strSt|art);...|
|00003e90| 09 69 66 20 28 65 72 72 | 20 21 3d 20 6e 6f 45 72 |.if (err| != noEr|
|00003ea0| 72 29 20 67 6f 74 6f 20 | 45 72 72 6f 72 45 78 69 |r) goto |ErrorExi|
|00003eb0| 74 3b 0d 09 09 09 0d 09 | 09 09 2f 2a 20 61 64 76 |t;......|../* adv|
|00003ec0| 61 6e 63 65 20 74 6f 20 | 6e 65 78 74 20 63 68 75 |ance to |next chu|
|00003ed0| 6e 6b 20 2a 2f 0d 09 09 | 09 73 74 72 4c 65 6e 20 |nk */...|.strLen |
|00003ee0| 2d 3d 20 28 73 74 72 45 | 6e 64 20 2d 20 73 74 72 |-= (strE|nd - str|
|00003ef0| 53 74 61 72 74 29 3b 0d | 09 09 09 73 74 72 53 74 |Start);.|...strSt|
|00003f00| 61 72 74 20 3d 20 73 74 | 72 45 6e 64 3b 0d 09 09 |art = st|rEnd;...|
|00003f10| 09 77 68 69 6c 65 20 28 | 73 74 72 4c 65 6e 20 3e |.while (|strLen >|
|00003f20| 20 30 20 26 26 20 28 73 | 74 72 53 74 61 72 74 5b | 0 && (s|trStart[|
|00003f30| 30 5d 20 3d 3d 20 27 20 | 27 20 7c 7c 20 73 74 72 |0] == ' |' || str|
|00003f40| 53 74 61 72 74 5b 30 5d | 20 3d 3d 20 27 5c 74 27 |Start[0]| == '\t'|
|00003f50| 29 29 0d 09 09 09 09 73 | 74 72 53 74 61 72 74 2b |)).....s|trStart+|
|00003f60| 2b 2c 20 73 74 72 4c 65 | 6e 2d 2d 3b 0d 09 09 09 |+, strLe|n--;....|
|00003f70| 0d 09 09 09 2f 2a 20 61 | 64 64 20 74 68 65 20 65 |..../* a|dd the e|
|00003f80| 6e 64 20 6f 66 20 74 68 | 69 73 20 6c 69 6e 65 20 |nd of th|is line |
|00003f90| 61 6e 64 20 74 68 65 20 | 73 74 61 72 74 20 6f 66 |and the |start of|
|00003fa0| 20 74 68 65 20 6e 65 78 | 74 20 2a 2f 0d 09 09 09 | the nex|t */....|
|00003fb0| 69 66 20 28 73 74 72 4c | 65 6e 20 3e 20 30 29 0d |if (strL|en > 0).|
|00003fc0| 09 09 09 7b 0d 09 09 09 | 09 65 72 72 20 3d 20 50 |...{....|.err = P|
|00003fd0| 74 72 41 6e 64 48 61 6e | 64 28 66 6f 72 6d 61 74 |trAndHan|d(format|
|00003fe0| 2d 3e 6c 69 6e 65 45 6e | 64 20 2b 20 31 2c 20 2a |->lineEn|d + 1, *|
|00003ff0| 63 6f 6d 6d 65 6e 74 48 | 61 6e 64 6c 65 2c 20 66 |commentH|andle, f|
|00004000| 6f 72 6d 61 74 2d 3e 6c | 69 6e 65 45 6e 64 5b 30 |ormat->l|ineEnd[0|
|00004010| 5d 29 3b 0d 09 09 09 09 | 69 66 20 28 65 72 72 20 |]);.....|if (err |
|00004020| 21 3d 20 6e 6f 45 72 72 | 29 20 67 6f 74 6f 20 45 |!= noErr|) goto E|
|00004030| 72 72 6f 72 45 78 69 74 | 3b 0d 09 09 09 09 63 20 |rrorExit|;.....c |
|00004040| 3d 20 27 5c 6e 27 3b 0d | 09 09 09 09 65 72 72 20 |= '\n';.|....err |
|00004050| 3d 20 50 74 72 41 6e 64 | 48 61 6e 64 28 26 63 2c |= PtrAnd|Hand(&c,|
|00004060| 20 2a 63 6f 6d 6d 65 6e | 74 48 61 6e 64 6c 65 2c | *commen|tHandle,|
|00004070| 20 31 29 3b 0d 09 09 09 | 09 69 66 20 28 65 72 72 | 1);....|.if (err|
|00004080| 20 21 3d 20 6e 6f 45 72 | 72 29 20 67 6f 74 6f 20 | != noEr|r) goto |
|00004090| 45 72 72 6f 72 45 78 69 | 74 3b 0d 09 09 09 09 65 |ErrorExi|t;.....e|
|000040a0| 72 72 20 3d 20 50 74 72 | 41 6e 64 48 61 6e 64 28 |rr = Ptr|AndHand(|
|000040b0| 66 6f 72 6d 61 74 2d 3e | 6c 69 6e 65 53 74 61 72 |format->|lineStar|
|000040c0| 74 20 2b 20 31 2c 20 2a | 63 6f 6d 6d 65 6e 74 48 |t + 1, *|commentH|
|000040d0| 61 6e 64 6c 65 2c 20 66 | 6f 72 6d 61 74 2d 3e 6c |andle, f|ormat->l|
|000040e0| 69 6e 65 53 74 61 72 74 | 5b 30 5d 29 3b 0d 09 09 |ineStart|[0]);...|
|000040f0| 09 09 69 66 20 28 65 72 | 72 20 21 3d 20 6e 6f 45 |..if (er|r != noE|
|00004100| 72 72 29 20 67 6f 74 6f | 20 45 72 72 6f 72 45 78 |rr) goto| ErrorEx|
|00004110| 69 74 3b 0d 09 09 09 09 | 65 72 72 20 3d 20 50 61 |it;.....|err = Pa|
|00004120| 64 54 6f 43 6f 6c 75 6d | 6e 28 2a 63 6f 6d 6d 65 |dToColum|n(*comme|
|00004130| 6e 74 48 61 6e 64 6c 65 | 2c 20 33 36 29 3b 0d 09 |ntHandle|, 36);..|
|00004140| 09 09 09 69 66 20 28 65 | 72 72 20 21 3d 20 6e 6f |...if (e|rr != no|
|00004150| 45 72 72 29 20 67 6f 74 | 6f 20 45 72 72 6f 72 45 |Err) got|o ErrorE|
|00004160| 78 69 74 3b 0d 09 09 09 | 7d 0d 09 09 7d 0d 09 7d |xit;....|}...}..}|
|00004170| 0d 09 0d 09 2f 2a 20 61 | 64 64 20 74 68 65 20 65 |..../* a|dd the e|
|00004180| 6e 64 20 6f 66 20 6c 69 | 6e 65 20 2a 2f 0d 09 65 |nd of li|ne */..e|
|00004190| 72 72 20 3d 20 50 74 72 | 41 6e 64 48 61 6e 64 28 |rr = Ptr|AndHand(|
|000041a0| 66 6f 72 6d 61 74 2d 3e | 6c 69 6e 65 45 6e 64 20 |format->|lineEnd |
|000041b0| 2b 20 31 2c 20 2a 63 6f | 6d 6d 65 6e 74 48 61 6e |+ 1, *co|mmentHan|
|000041c0| 64 6c 65 2c 20 66 6f 72 | 6d 61 74 2d 3e 6c 69 6e |dle, for|mat->lin|
|000041d0| 65 45 6e 64 5b 30 5d 29 | 3b 0d 09 69 66 20 28 65 |eEnd[0])|;..if (e|
|000041e0| 72 72 20 21 3d 20 6e 6f | 45 72 72 29 20 67 6f 74 |rr != no|Err) got|
|000041f0| 6f 20 45 72 72 6f 72 45 | 78 69 74 3b 0d 09 63 20 |o ErrorE|xit;..c |
|00004200| 3d 20 27 5c 6e 27 3b 0d | 09 65 72 72 20 3d 20 50 |= '\n';.|.err = P|
|00004210| 74 72 41 6e 64 48 61 6e | 64 28 26 63 2c 20 2a 63 |trAndHan|d(&c, *c|
|00004220| 6f 6d 6d 65 6e 74 48 61 | 6e 64 6c 65 2c 20 31 29 |ommentHa|ndle, 1)|
|00004230| 3b 0d 09 69 66 20 28 65 | 72 72 20 21 3d 20 6e 6f |;..if (e|rr != no|
|00004240| 45 72 72 29 20 67 6f 74 | 6f 20 45 72 72 6f 72 45 |Err) got|o ErrorE|
|00004250| 78 69 74 3b 0d 09 72 65 | 74 75 72 6e 20 6e 6f 45 |xit;..re|turn noE|
|00004260| 72 72 3b 0d 09 0d 45 72 | 72 6f 72 45 78 69 74 3a |rr;...Er|rorExit:|
|00004270| 0d 09 69 66 20 28 2a 63 | 6f 6d 6d 65 6e 74 48 61 |..if (*c|ommentHa|
|00004280| 6e 64 6c 65 20 21 3d 20 | 4e 55 4c 4c 29 0d 09 7b |ndle != |NULL)..{|
|00004290| 0d 09 09 44 69 73 70 6f | 73 65 48 61 6e 64 6c 65 |...Dispo|seHandle|
|000042a0| 28 2a 63 6f 6d 6d 65 6e | 74 48 61 6e 64 6c 65 29 |(*commen|tHandle)|
|000042b0| 3b 0d 09 09 2a 63 6f 6d | 6d 65 6e 74 48 61 6e 64 |;...*com|mentHand|
|000042c0| 6c 65 20 3d 20 4e 55 4c | 4c 3b 0d 09 7d 0d 09 72 |le = NUL|L;..}..r|
|000042d0| 65 74 75 72 6e 20 65 72 | 72 3b 0d 7d 0d 0d 0d 4f |eturn er|r;.}...O|
|000042e0| 53 45 72 72 20 47 65 74 | 46 69 72 73 74 54 69 6d |SErr Get|FirstTim|
|000042f0| 65 48 65 61 64 65 72 28 | 53 74 72 69 6e 67 48 61 |eHeader(|StringHa|
|00004300| 6e 64 6c 65 20 2a 68 65 | 61 64 65 72 2c 20 46 53 |ndle *he|ader, FS|
|00004310| 53 70 65 63 20 2a 66 69 | 6c 65 2c 20 43 6f 6d 6d |Spec *fi|le, Comm|
|00004320| 65 6e 74 46 6f 72 6d 61 | 74 20 2a 66 6f 72 6d 61 |entForma|t *forma|
|00004330| 74 2c 0d 09 09 09 09 09 | 09 20 20 53 74 72 69 6e |t,......|. Strin|
|00004340| 67 50 74 72 20 75 73 65 | 72 4e 61 6d 65 2c 20 53 |gPtr use|rName, S|
|00004350| 74 72 69 6e 67 50 74 72 | 20 6e 69 63 6b 6e 61 6d |tringPtr| nicknam|
|00004360| 65 2c 20 53 74 72 69 6e | 67 50 74 72 20 63 6f 6d |e, Strin|gPtr com|
|00004370| 6d 65 6e 74 2c 20 42 6f | 6f 6c 65 61 6e 20 63 68 |ment, Bo|olean ch|
|00004380| 65 63 6b 69 6e 67 4f 75 | 74 29 0d 7b 0d 09 53 74 |eckingOu|t).{..St|
|00004390| 72 69 6e 67 48 61 6e 64 | 6c 65 20 63 6f 6d 6d 65 |ringHand|le comme|
|000043a0| 6e 74 48 61 6e 64 6c 65 | 20 3d 20 4e 55 4c 4c 3b |ntHandle| = NULL;|
|000043b0| 0d 09 73 68 6f 72 74 20 | 72 65 76 69 73 69 6f 6e |..short |revision|
|000043c0| 3b 0d 09 4f 53 45 72 72 | 20 65 72 72 20 3d 20 6e |;..OSErr| err = n|
|000043d0| 6f 45 72 72 3b 0d 09 63 | 68 61 72 20 63 3b 0d 0d |oErr;..c|har c;..|
|000043e0| 09 2f 2a 20 67 65 74 20 | 74 68 65 20 74 65 6d 70 |./* get |the temp|
|000043f0| 6c 61 74 65 20 66 72 6f | 6d 20 74 68 65 20 73 74 |late fro|m the st|
|00004400| 72 69 6e 67 20 69 6e 20 | 6f 75 72 20 72 65 73 6f |ring in |our reso|
|00004410| 75 72 63 65 20 66 69 6c | 65 20 2a 2f 0d 09 2a 68 |urce fil|e */..*h|
|00004420| 65 61 64 65 72 20 3d 20 | 47 65 74 31 52 65 73 6f |eader = |Get1Reso|
|00004430| 75 72 63 65 28 27 43 6f | 6d 6d 27 2c 20 31 29 3b |urce('Co|mm', 1);|
|00004440| 0d 09 69 66 20 28 2a 68 | 65 61 64 65 72 20 3d 3d |..if (*h|eader ==|
|00004450| 20 4e 55 4c 4c 29 0d 09 | 7b 0d 09 09 65 72 72 20 | NULL)..|{...err |
|00004460| 3d 20 72 65 73 4e 6f 74 | 46 6f 75 6e 64 3b 0d 09 |= resNot|Found;..|
|00004470| 09 67 6f 74 6f 20 45 72 | 72 6f 72 45 78 69 74 3b |.goto Er|rorExit;|
|00004480| 0d 09 7d 0d 09 44 65 74 | 61 63 68 52 65 73 6f 75 |..}..Det|achResou|
|00004490| 72 63 65 28 2a 68 65 61 | 64 65 72 29 3b 0d 09 0d |rce(*hea|der);...|
|000044a0| 09 2f 2a 20 73 75 62 73 | 74 69 74 75 74 65 20 74 |./* subs|titute t|
|000044b0| 68 65 20 63 6f 6d 6d 65 | 6e 74 20 63 68 61 72 61 |he comme|nt chara|
|000044c0| 63 74 65 72 73 20 2a 2f | 0d 09 65 72 72 20 3d 20 |cters */|..err = |
|000044d0| 53 75 62 73 74 69 74 75 | 74 65 43 6f 6d 6d 65 6e |Substitu|teCommen|
|000044e0| 74 73 28 2a 68 65 61 64 | 65 72 2c 20 66 6f 72 6d |ts(*head|er, form|
|000044f0| 61 74 29 3b 0d 09 69 66 | 20 28 65 72 72 20 3c 20 |at);..if| (err < |
|00004500| 6e 6f 45 72 72 29 20 67 | 6f 74 6f 20 45 72 72 6f |noErr) g|oto Erro|
|00004510| 72 45 78 69 74 3b 0d 09 | 0d 09 2f 2a 20 73 75 62 |rExit;..|../* sub|
|00004520| 73 74 69 74 75 74 65 20 | 74 68 65 20 66 69 6c 65 |stitute |the file|
|00004530| 20 6e 61 6d 65 20 2a 2f | 0d 09 65 72 72 20 3d 20 | name */|..err = |
|00004540| 52 65 70 6c 61 63 65 53 | 74 72 69 6e 67 28 2a 68 |ReplaceS|tring(*h|
|00004550| 65 61 64 65 72 2c 20 22 | 5c 70 3c 66 69 6c 65 20 |eader, "|\p<file |
|00004560| 6e 61 6d 65 3e 22 2c 20 | 66 69 6c 65 2d 3e 6e 61 |name>", |file->na|
|00004570| 6d 65 29 3b 0d 09 69 66 | 20 28 65 72 72 20 3c 20 |me);..if| (err < |
|00004580| 6e 6f 45 72 72 29 20 67 | 6f 74 6f 20 45 72 72 6f |noErr) g|oto Erro|
|00004590| 72 45 78 69 74 3b 0d 09 | 0d 09 2f 2a 20 73 75 62 |rExit;..|../* sub|
|000045a0| 73 74 69 74 75 74 65 20 | 74 68 65 20 75 73 65 72 |stitute |the user|
|000045b0| 20 6e 61 6d 65 20 2a 2f | 0d 09 65 72 72 20 3d 20 | name */|..err = |
|000045c0| 52 65 70 6c 61 63 65 53 | 74 72 69 6e 67 28 2a 68 |ReplaceS|tring(*h|
|000045d0| 65 61 64 65 72 2c 20 22 | 5c 70 3c 75 73 65 72 20 |eader, "|\p<user |
|000045e0| 6e 61 6d 65 3e 22 2c 20 | 75 73 65 72 4e 61 6d 65 |name>", |userName|
|000045f0| 29 3b 0d 09 69 66 20 28 | 65 72 72 20 3c 20 6e 6f |);..if (|err < no|
|00004600| 45 72 72 29 20 67 6f 74 | 6f 20 45 72 72 6f 72 45 |Err) got|o ErrorE|
|00004610| 78 69 74 3b 0d 09 0d 09 | 2f 2a 20 58 58 58 20 73 |xit;....|/* XXX s|
|00004620| 75 62 73 74 69 74 75 74 | 65 20 74 68 65 20 63 6f |ubstitut|e the co|
|00004630| 70 79 72 69 67 68 74 20 | 2a 2f 0d 0d 09 2f 2a 20 |pyright |*/.../* |
|00004640| 67 65 74 20 74 68 65 20 | 72 65 76 69 73 69 6f 6e |get the |revision|
|00004650| 20 6e 75 6d 62 65 72 20 | 66 72 6f 6d 20 74 68 65 | number |from the|
|00004660| 20 43 4b 49 44 20 2a 2f | 0d 09 65 72 72 20 3d 20 | CKID */|..err = |
|00004670| 47 65 74 52 65 76 69 73 | 69 6f 6e 4e 75 6d 62 65 |GetRevis|ionNumbe|
|00004680| 72 28 66 69 6c 65 2c 20 | 26 72 65 76 69 73 69 6f |r(file, |&revisio|
|00004690| 6e 29 3b 0d 09 69 66 20 | 28 65 72 72 20 21 3d 20 |n);..if |(err != |
|000046a0| 6e 6f 45 72 72 29 20 67 | 6f 74 6f 20 45 72 72 6f |noErr) g|oto Erro|
|000046b0| 72 45 78 69 74 3b 0d 09 | 0d 09 65 72 72 20 3d 20 |rExit;..|..err = |
|000046c0| 42 75 69 6c 64 43 6f 6d | 6d 65 6e 74 28 26 63 6f |BuildCom|ment(&co|
|000046d0| 6d 6d 65 6e 74 48 61 6e | 64 6c 65 2c 20 66 6f 72 |mmentHan|dle, for|
|000046e0| 6d 61 74 2c 20 72 65 76 | 69 73 69 6f 6e 2c 20 63 |mat, rev|ision, c|
|000046f0| 68 65 63 6b 69 6e 67 4f | 75 74 2c 20 63 6f 6d 6d |heckingO|ut, comm|
|00004700| 65 6e 74 2c 20 6e 69 63 | 6b 6e 61 6d 65 29 3b 0d |ent, nic|kname);.|
|00004710| 09 69 66 20 28 65 72 72 | 20 21 3d 20 6e 6f 45 72 |.if (err| != noEr|
|00004720| 72 29 20 67 6f 74 6f 20 | 45 72 72 6f 72 45 78 69 |r) goto |ErrorExi|
|00004730| 74 3b 0d 09 0d 09 2f 2a | 20 61 70 70 65 6e 64 20 |t;..../*| append |
|00004740| 74 68 65 20 63 68 61 6e | 67 65 20 63 6f 6d 6d 65 |the chan|ge comme|
|00004750| 6e 74 20 74 6f 20 74 68 | 65 20 68 65 61 64 65 72 |nt to th|e header|
|00004760| 20 2a 2f 0d 09 65 72 72 | 20 3d 20 48 61 6e 64 41 | */..err| = HandA|
|00004770| 6e 64 48 61 6e 64 28 63 | 6f 6d 6d 65 6e 74 48 61 |ndHand(c|ommentHa|
|00004780| 6e 64 6c 65 2c 20 2a 68 | 65 61 64 65 72 29 3b 0d |ndle, *h|eader);.|
|00004790| 09 44 69 73 70 6f 73 65 | 48 61 6e 64 6c 65 28 63 |.Dispose|Handle(c|
|000047a0| 6f 6d 6d 65 6e 74 48 61 | 6e 64 6c 65 29 3b 0d 09 |ommentHa|ndle);..|
|000047b0| 63 6f 6d 6d 65 6e 74 48 | 61 6e 64 6c 65 20 3d 20 |commentH|andle = |
|000047c0| 4e 55 4c 4c 3b 0d 09 69 | 66 20 28 65 72 72 20 21 |NULL;..i|f (err !|
|000047d0| 3d 20 6e 6f 45 72 72 29 | 20 67 6f 74 6f 20 45 72 |= noErr)| goto Er|
|000047e0| 72 6f 72 45 78 69 74 3b | 0d 09 0d 09 2f 2a 20 61 |rorExit;|..../* a|
|000047f0| 70 70 65 6e 64 20 74 68 | 65 20 63 6f 6d 6d 65 6e |ppend th|e commen|
|00004800| 74 20 65 6e 64 20 2a 2f | 0d 09 65 72 72 20 3d 20 |t end */|..err = |
|00004810| 50 74 72 41 6e 64 48 61 | 6e 64 28 66 6f 72 6d 61 |PtrAndHa|nd(forma|
|00004820| 74 2d 3e 63 6f 6d 6d 65 | 6e 74 45 6e 64 20 2b 20 |t->comme|ntEnd + |
|00004830| 31 2c 20 2a 68 65 61 64 | 65 72 2c 20 66 6f 72 6d |1, *head|er, form|
|00004840| 61 74 2d 3e 63 6f 6d 6d | 65 6e 74 45 6e 64 5b 30 |at->comm|entEnd[0|
|00004850| 5d 29 3b 0d 09 69 66 20 | 28 65 72 72 20 21 3d 20 |]);..if |(err != |
|00004860| 6e 6f 45 72 72 29 20 67 | 6f 74 6f 20 45 72 72 6f |noErr) g|oto Erro|
|00004870| 72 45 78 69 74 3b 0d 09 | 0d 09 2f 2a 20 61 64 64 |rExit;..|../* add|
|00004880| 20 61 6e 6f 74 68 65 72 | 20 62 6c 61 6e 6b 20 6c | another| blank l|
|00004890| 69 6e 65 20 6f 72 20 74 | 77 6f 20 2a 2f 0d 09 63 |ine or t|wo */..c|
|000048a0| 20 3d 20 27 5c 6e 27 3b | 0d 09 65 72 72 20 3d 20 | = '\n';|..err = |
|000048b0| 50 74 72 41 6e 64 48 61 | 6e 64 28 26 63 2c 20 2a |PtrAndHa|nd(&c, *|
|000048c0| 68 65 61 64 65 72 2c 20 | 31 29 3b 0d 09 69 66 20 |header, |1);..if |
|000048d0| 28 65 72 72 20 21 3d 20 | 6e 6f 45 72 72 29 20 67 |(err != |noErr) g|
|000048e0| 6f 74 6f 20 45 72 72 6f | 72 45 78 69 74 3b 0d 09 |oto Erro|rExit;..|
|000048f0| 65 72 72 20 3d 20 50 74 | 72 41 6e 64 48 61 6e 64 |err = Pt|rAndHand|
|00004900| 28 26 63 2c 20 2a 68 65 | 61 64 65 72 2c 20 31 29 |(&c, *he|ader, 1)|
|00004910| 3b 0d 09 69 66 20 28 65 | 72 72 20 21 3d 20 6e 6f |;..if (e|rr != no|
|00004920| 45 72 72 29 20 67 6f 74 | 6f 20 45 72 72 6f 72 45 |Err) got|o ErrorE|
|00004930| 78 69 74 3b 0d 0d 09 72 | 65 74 75 72 6e 20 6e 6f |xit;...r|eturn no|
|00004940| 45 72 72 3b 0d 09 0d 45 | 72 72 6f 72 45 78 69 74 |Err;...E|rrorExit|
|00004950| 3a 0d 09 69 66 20 28 2a | 68 65 61 64 65 72 20 21 |:..if (*|header !|
|00004960| 3d 20 4e 55 4c 4c 29 0d | 09 7b 0d 09 09 44 69 73 |= NULL).|.{...Dis|
|00004970| 70 6f 73 65 48 61 6e 64 | 6c 65 28 2a 68 65 61 64 |poseHand|le(*head|
|00004980| 65 72 29 3b 0d 09 09 2a | 68 65 61 64 65 72 20 3d |er);...*|header =|
|00004990| 20 4e 55 4c 4c 3b 0d 09 | 7d 0d 09 69 66 20 28 63 | NULL;..|}..if (c|
|000049a0| 6f 6d 6d 65 6e 74 48 61 | 6e 64 6c 65 20 21 3d 20 |ommentHa|ndle != |
|000049b0| 4e 55 4c 4c 29 0d 09 09 | 44 69 73 70 6f 73 65 48 |NULL)...|DisposeH|
|000049c0| 61 6e 64 6c 65 28 63 6f | 6d 6d 65 6e 74 48 61 6e |andle(co|mmentHan|
|000049d0| 64 6c 65 29 3b 0d 09 72 | 65 74 75 72 6e 20 65 72 |dle);..r|eturn er|
|000049e0| 72 3b 0d 7d 0d 0d 0d 4f | 53 45 72 72 20 45 78 74 |r;.}...O|SErr Ext|
|000049f0| 72 61 63 74 46 69 6c 65 | 48 65 61 64 65 72 28 43 |ractFile|Header(C|
|00004a00| 6f 6d 6d 65 6e 74 46 6f | 72 6d 61 74 20 2a 66 6f |ommentFo|rmat *fo|
|00004a10| 72 6d 61 74 2c 20 48 61 | 6e 64 6c 65 20 66 69 6c |rmat, Ha|ndle fil|
|00004a20| 65 44 61 74 61 2c 0d 09 | 09 09 09 09 09 20 20 53 |eData,..|..... S|
|00004a30| 74 72 69 6e 67 48 61 6e | 64 6c 65 20 2a 68 65 61 |tringHan|dle *hea|
|00004a40| 64 65 72 2c 20 6c 6f 6e | 67 20 2a 68 65 61 64 65 |der, lon|g *heade|
|00004a50| 72 45 6e 64 29 0d 7b 0d | 09 53 74 72 69 6e 67 48 |rEnd).{.|.StringH|
|00004a60| 61 6e 64 6c 65 20 62 6c | 61 6e 6b 48 65 61 64 65 |andle bl|ankHeade|
|00004a70| 72 20 3d 20 4e 55 4c 4c | 3b 0d 09 42 6f 6f 6c 65 |r = NULL|;..Boole|
|00004a80| 61 6e 20 61 74 45 6e 64 | 3b 0d 09 42 6f 6f 6c 65 |an atEnd|;..Boole|
|00004a90| 61 6e 20 6c 61 73 74 4c | 69 6e 65 4d 61 74 63 68 |an lastL|ineMatch|
|00004aa0| 65 64 43 6f 6d 6d 65 6e | 74 45 6e 64 3b 0d 09 4f |edCommen|tEnd;..O|
|00004ab0| 53 45 72 72 20 65 72 72 | 3b 0d 09 53 74 72 69 6e |SErr err|;..Strin|
|00004ac0| 67 50 74 72 20 66 69 6c | 65 4c 69 6e 65 3b 0d 09 |gPtr fil|eLine;..|
|00004ad0| 6c 6f 6e 67 20 66 69 6c | 65 4c 65 6e 67 74 68 2c |long fil|eLength,|
|00004ae0| 20 66 69 6c 65 4c 69 6e | 65 4c 65 6e 67 74 68 2c | fileLin|eLength,|
|00004af0| 20 68 65 61 64 65 72 4c | 65 6e 67 74 68 3b 0d 09 | headerL|ength;..|
|00004b00| 42 79 74 65 20 66 69 6c | 65 53 74 61 74 65 3b 0d |Byte fil|eState;.|
|00004b10| 09 0d 09 2f 2a 20 67 65 | 74 20 62 6c 61 6e 6b 20 |.../* ge|t blank |
|00004b20| 68 65 61 64 65 72 20 66 | 72 6f 6d 20 73 74 72 69 |header f|rom stri|
|00004b30| 6e 67 20 72 65 73 6f 75 | 72 63 65 20 2a 2f 0d 09 |ng resou|rce */..|
|00004b40| 62 6c 61 6e 6b 48 65 61 | 64 65 72 20 3d 20 47 65 |blankHea|der = Ge|
|00004b50| 74 31 52 65 73 6f 75 72 | 63 65 28 27 43 6f 6d 6d |t1Resour|ce('Comm|
|00004b60| 27 2c 20 31 29 3b 0d 09 | 69 66 20 28 62 6c 61 6e |', 1);..|if (blan|
|00004b70| 6b 48 65 61 64 65 72 20 | 3d 3d 20 4e 55 4c 4c 29 |kHeader |== NULL)|
|00004b80| 0d 09 7b 0d 09 09 65 72 | 72 20 3d 20 72 65 73 4e |..{...er|r = resN|
|00004b90| 6f 74 46 6f 75 6e 64 3b | 0d 09 09 67 6f 74 6f 20 |otFound;|...goto |
|00004ba0| 45 72 72 6f 72 45 78 69 | 74 3b 0d 09 7d 0d 09 44 |ErrorExi|t;..}..D|
|00004bb0| 65 74 61 63 68 52 65 73 | 6f 75 72 63 65 28 62 6c |etachRes|ource(bl|
|00004bc0| 61 6e 6b 48 65 61 64 65 | 72 29 3b 0d 09 0d 09 2f |ankHeade|r);..../|
|00004bd0| 2a 20 73 75 62 73 74 69 | 74 75 74 65 20 74 68 65 |* substi|tute the|
|00004be0| 20 63 6f 6d 6d 65 6e 74 | 20 63 68 61 72 61 63 74 | comment| charact|
|00004bf0| 65 72 73 20 2a 2f 0d 09 | 65 72 72 20 3d 20 53 75 |ers */..|err = Su|
|00004c00| 62 73 74 69 74 75 74 65 | 43 6f 6d 6d 65 6e 74 73 |bstitute|Comments|
|00004c10| 28 62 6c 61 6e 6b 48 65 | 61 64 65 72 2c 20 66 6f |(blankHe|ader, fo|
|00004c20| 72 6d 61 74 29 3b 0d 09 | 69 66 20 28 65 72 72 20 |rmat);..|if (err |
|00004c30| 21 3d 20 6e 6f 45 72 72 | 29 20 67 6f 74 6f 20 45 |!= noErr|) goto E|
|00004c40| 72 72 6f 72 45 78 69 74 | 3b 0d 09 0d 09 2f 2a 20 |rrorExit|;..../* |
|00004c50| 67 65 74 20 74 68 65 20 | 68 65 61 64 65 72 20 2a |get the |header *|
|00004c60| 2f 0d 09 65 72 72 20 3d | 20 47 65 74 48 65 61 64 |/..err =| GetHead|
|00004c70| 65 72 46 72 6f 6d 46 69 | 6c 65 28 66 69 6c 65 44 |erFromFi|le(fileD|
|00004c80| 61 74 61 2c 20 66 6f 72 | 6d 61 74 2c 20 62 6c 61 |ata, for|mat, bla|
|00004c90| 6e 6b 48 65 61 64 65 72 | 2c 20 68 65 61 64 65 72 |nkHeader|, header|
|00004ca0| 29 3b 0d 09 69 66 20 28 | 65 72 72 20 21 3d 20 6e |);..if (|err != n|
|00004cb0| 6f 45 72 72 29 20 67 6f | 74 6f 20 45 72 72 6f 72 |oErr) go|to Error|
|00004cc0| 45 78 69 74 3b 0d 09 0d | 09 2f 2a 20 6d 61 74 63 |Exit;...|./* matc|
|00004cd0| 68 65 64 20 69 74 21 20 | 6c 6f 6f 70 20 6f 76 65 |hed it! |loop ove|
|00004ce0| 72 20 6c 69 6e 65 73 20 | 74 6f 20 74 68 65 20 65 |r lines |to the e|
|00004cf0| 6e 64 20 6f 66 20 63 6f | 6d 6d 65 6e 74 2c 20 61 |nd of co|mment, a|
|00004d00| 64 64 69 6e 67 20 65 61 | 63 68 0d 09 20 2a 20 6c |dding ea|ch.. * l|
|00004d10| 69 6e 65 20 74 6f 20 74 | 68 65 20 68 61 6e 64 6c |ine to t|he handl|
|00004d20| 65 0d 09 20 2a 2f 0d 09 | 68 65 61 64 65 72 4c 65 |e.. */..|headerLe|
|00004d30| 6e 67 74 68 20 3d 20 47 | 65 74 48 61 6e 64 6c 65 |ngth = G|etHandle|
|00004d40| 53 69 7a 65 28 2a 68 65 | 61 64 65 72 29 3b 0d 09 |Size(*he|ader);..|
|00004d50| 66 69 6c 65 53 74 61 74 | 65 20 3d 20 48 47 65 74 |fileStat|e = HGet|
|00004d60| 53 74 61 74 65 28 66 69 | 6c 65 44 61 74 61 29 3b |State(fi|leData);|
|00004d70| 0d 09 48 4c 6f 63 6b 28 | 66 69 6c 65 44 61 74 61 |..HLock(|fileData|
|00004d80| 29 3b 0d 09 66 69 6c 65 | 4c 65 6e 67 74 68 20 3d |);..file|Length =|
|00004d90| 20 47 65 74 48 61 6e 64 | 6c 65 53 69 7a 65 28 66 | GetHand|leSize(f|
|00004da0| 69 6c 65 44 61 74 61 29 | 20 2d 20 68 65 61 64 65 |ileData)| - heade|
|00004db0| 72 4c 65 6e 67 74 68 3b | 0d 09 66 69 6c 65 4c 69 |rLength;|..fileLi|
|00004dc0| 6e 65 20 3d 20 28 2a 66 | 69 6c 65 44 61 74 61 29 |ne = (*f|ileData)|
|00004dd0| 20 2b 20 68 65 61 64 65 | 72 4c 65 6e 67 74 68 3b | + heade|rLength;|
|00004de0| 0d 09 66 69 6c 65 4c 69 | 6e 65 4c 65 6e 67 74 68 |..fileLi|neLength|
|00004df0| 20 3d 20 4c 69 6e 65 53 | 69 7a 65 28 66 69 6c 65 | = LineS|ize(file|
|00004e00| 4c 69 6e 65 2c 20 66 69 | 6c 65 4c 65 6e 67 74 68 |Line, fi|leLength|
|00004e10| 29 3b 0d 09 61 74 45 6e | 64 20 3d 20 6c 61 73 74 |);..atEn|d = last|
|00004e20| 4c 69 6e 65 4d 61 74 63 | 68 65 64 43 6f 6d 6d 65 |LineMatc|hedComme|
|00004e30| 6e 74 45 6e 64 20 3d 20 | 66 61 6c 73 65 3b 0d 09 |ntEnd = |false;..|
|00004e40| 64 6f 0d 09 7b 0d 09 09 | 61 74 45 6e 64 20 3d 20 |do..{...|atEnd = |
|00004e50| 6c 61 73 74 4c 69 6e 65 | 4d 61 74 63 68 65 64 43 |lastLine|MatchedC|
|00004e60| 6f 6d 6d 65 6e 74 45 6e | 64 20 26 26 20 66 69 6c |ommentEn|d && fil|
|00004e70| 65 4c 69 6e 65 4c 65 6e | 67 74 68 20 3d 3d 20 31 |eLineLen|gth == 1|
|00004e80| 20 26 26 20 2a 66 69 6c | 65 4c 69 6e 65 20 3d 3d | && *fil|eLine ==|
|00004e90| 20 27 5c 6e 27 3b 0d 09 | 09 69 66 20 28 61 74 45 | '\n';..|.if (atE|
|00004ea0| 6e 64 29 20 62 72 65 61 | 6b 3b 0d 09 09 0d 09 09 |nd) brea|k;......|
|00004eb0| 6c 61 73 74 4c 69 6e 65 | 4d 61 74 63 68 65 64 43 |lastLine|MatchedC|
|00004ec0| 6f 6d 6d 65 6e 74 45 6e | 64 20 3d 20 4d 61 74 63 |ommentEn|d = Matc|
|00004ed0| 68 4c 69 6e 65 28 66 69 | 6c 65 4c 69 6e 65 2c 20 |hLine(fi|leLine, |
|00004ee0| 66 69 6c 65 4c 69 6e 65 | 4c 65 6e 67 74 68 2c 20 |fileLine|Length, |
|00004ef0| 66 6f 72 6d 61 74 2d 3e | 63 6f 6d 6d 65 6e 74 45 |format->|commentE|
|00004f00| 6e 64 20 2b 20 31 2c 20 | 66 6f 72 6d 61 74 2d 3e |nd + 1, |format->|
|00004f10| 63 6f 6d 6d 65 6e 74 45 | 6e 64 5b 30 5d 29 3b 0d |commentE|nd[0]);.|
|00004f20| 09 0d 09 09 2f 2a 20 61 | 63 63 75 6d 75 6c 61 74 |..../* a|ccumulat|
|00004f30| 65 20 6c 69 6e 65 20 69 | 6e 74 6f 20 68 65 61 64 |e line i|nto head|
|00004f40| 65 72 20 2a 2f 0d 09 09 | 65 72 72 20 3d 20 50 74 |er */...|err = Pt|
|00004f50| 72 41 6e 64 48 61 6e 64 | 28 66 69 6c 65 4c 69 6e |rAndHand|(fileLin|
|00004f60| 65 2c 20 2a 68 65 61 64 | 65 72 2c 20 66 69 6c 65 |e, *head|er, file|
|00004f70| 4c 69 6e 65 4c 65 6e 67 | 74 68 29 3b 0d 09 09 69 |LineLeng|th);...i|
|00004f80| 66 20 28 65 72 72 20 21 | 3d 20 6e 6f 45 72 72 29 |f (err !|= noErr)|
|00004f90| 20 67 6f 74 6f 20 45 72 | 72 6f 72 45 78 69 74 3b | goto Er|rorExit;|
|00004fa0| 0d 09 09 0d 09 09 2f 2a | 20 61 64 76 61 6e 63 65 |....../*| advance|
|00004fb0| 20 74 68 65 20 66 69 6c | 65 20 64 61 74 61 20 70 | the fil|e data p|
|00004fc0| 6f 69 6e 74 65 72 20 2a | 2f 0d 09 09 66 69 6c 65 |ointer *|/...file|
|00004fd0| 4c 69 6e 65 20 2b 3d 20 | 66 69 6c 65 4c 69 6e 65 |Line += |fileLine|
|00004fe0| 4c 65 6e 67 74 68 3b 0d | 09 09 66 69 6c 65 4c 65 |Length;.|..fileLe|
|00004ff0| 6e 67 74 68 20 2d 3d 20 | 66 69 6c 65 4c 69 6e 65 |ngth -= |fileLine|
|00005000| 4c 65 6e 67 74 68 3b 0d | 09 09 66 69 6c 65 4c 69 |Length;.|..fileLi|
|00005010| 6e 65 4c 65 6e 67 74 68 | 20 3d 20 4c 69 6e 65 53 |neLength| = LineS|
|00005020| 69 7a 65 28 66 69 6c 65 | 4c 69 6e 65 2c 20 66 69 |ize(file|Line, fi|
|00005030| 6c 65 4c 65 6e 67 74 68 | 29 3b 0d 09 7d 20 77 68 |leLength|);..} wh|
|00005040| 69 6c 65 20 28 66 69 6c | 65 4c 65 6e 67 74 68 20 |ile (fil|eLength |
|00005050| 3e 20 30 29 3b 0d 09 0d | 09 48 53 65 74 53 74 61 |> 0);...|.HSetSta|
|00005060| 74 65 28 66 69 6c 65 44 | 61 74 61 2c 20 66 69 6c |te(fileD|ata, fil|
|00005070| 65 53 74 61 74 65 29 3b | 0d 09 0d 09 2f 2a 20 72 |eState);|..../* r|
|00005080| 65 74 75 72 6e 20 74 68 | 65 20 65 6e 64 2d 6f 66 |eturn th|e end-of|
|00005090| 2d 68 65 61 64 65 72 20 | 6f 66 66 73 65 74 20 2a |-header |offset *|
|000050a0| 2f 0d 09 2a 68 65 61 64 | 65 72 45 6e 64 20 3d 20 |/..*head|erEnd = |
|000050b0| 47 65 74 48 61 6e 64 6c | 65 53 69 7a 65 28 2a 68 |GetHandl|eSize(*h|
|000050c0| 65 61 64 65 72 29 3b 0d | 09 0d 09 44 69 73 70 6f |eader);.|...Dispo|
|000050d0| 73 65 48 61 6e 64 6c 65 | 28 62 6c 61 6e 6b 48 65 |seHandle|(blankHe|
|000050e0| 61 64 65 72 29 3b 0d 09 | 72 65 74 75 72 6e 20 6e |ader);..|return n|
|000050f0| 6f 45 72 72 3b 0d 0d 45 | 72 72 6f 72 45 78 69 74 |oErr;..E|rrorExit|
|00005100| 3a 0d 09 69 66 20 28 62 | 6c 61 6e 6b 48 65 61 64 |:..if (b|lankHead|
|00005110| 65 72 20 21 3d 20 4e 55 | 4c 4c 29 0d 09 09 44 69 |er != NU|LL)...Di|
|00005120| 73 70 6f 73 65 48 61 6e | 64 6c 65 28 62 6c 61 6e |sposeHan|dle(blan|
|00005130| 6b 48 65 61 64 65 72 29 | 3b 0d 09 72 65 74 75 72 |kHeader)|;..retur|
|00005140| 6e 20 65 72 72 3b 0d 7d | 0d 0d 0d 4f 53 45 72 72 |n err;.}|...OSErr|
|00005150| 20 45 78 74 72 61 63 74 | 43 75 72 72 65 6e 74 43 | Extract|CurrentC|
|00005160| 68 61 6e 67 65 43 6f 6d | 6d 65 6e 74 28 43 6f 6d |hangeCom|ment(Com|
|00005170| 6d 65 6e 74 46 6f 72 6d | 61 74 20 2a 66 6f 72 6d |mentForm|at *form|
|00005180| 61 74 2c 20 53 74 72 69 | 6e 67 48 61 6e 64 6c 65 |at, Stri|ngHandle|
|00005190| 20 68 65 61 64 65 72 2c | 20 53 74 72 69 6e 67 50 | header,| StringP|
|000051a0| 74 72 20 63 6f 6d 6d 65 | 6e 74 29 0d 7b 0d 09 4f |tr comme|nt).{..O|
|000051b0| 53 45 72 72 20 65 72 72 | 20 3d 20 6e 6f 45 72 72 |SErr err| = noErr|
|000051c0| 3b 0d 09 53 74 72 69 6e | 67 48 61 6e 64 6c 65 20 |;..Strin|gHandle |
|000051d0| 68 20 3d 20 4e 55 4c 4c | 3b 0d 09 6c 6f 6e 67 20 |h = NULL|;..long |
|000051e0| 73 74 61 72 74 2c 20 65 | 6e 64 3b 0d 09 42 79 74 |start, e|nd;..Byt|
|000051f0| 65 20 73 74 61 74 65 3b | 0d 09 53 74 72 69 6e 67 |e state;|..String|
|00005200| 50 74 72 20 73 3b 0d 09 | 6c 6f 6e 67 20 69 3b 0d |Ptr s;..|long i;.|
|00005210| 09 6c 6f 6e 67 20 73 74 | 72 69 70 4c 65 6e 67 74 |.long st|ripLengt|
|00005220| 68 3b 0d 09 6c 6f 6e 67 | 20 6c 65 6e 67 74 68 3b |h;..long| length;|
|00005230| 0d 09 42 6f 6f 6c 65 61 | 6e 20 67 6f 74 50 6c 75 |..Boolea|n gotPlu|
|00005240| 73 53 69 67 6e 3b 0d 09 | 0d 09 2f 2a 20 67 65 74 |sSign;..|../* get|
|00005250| 20 74 68 65 20 6c 6f 63 | 61 74 69 6f 6e 20 6f 66 | the loc|ation of|
|00005260| 20 74 68 65 20 66 69 72 | 73 74 20 63 68 61 6e 67 | the fir|st chang|
|00005270| 65 20 63 6f 6d 6d 65 6e | 74 20 2a 2f 0d 09 65 72 |e commen|t */..er|
|00005280| 72 20 3d 20 46 69 6e 64 | 46 69 72 73 74 43 68 61 |r = Find|FirstCha|
|00005290| 6e 67 65 43 6f 6d 6d 65 | 6e 74 28 68 65 61 64 65 |ngeComme|nt(heade|
|000052a0| 72 2c 20 66 6f 72 6d 61 | 74 2c 20 26 73 74 61 72 |r, forma|t, &star|
|000052b0| 74 2c 20 26 65 6e 64 29 | 3b 0d 09 69 66 20 28 65 |t, &end)|;..if (e|
|000052c0| 72 72 20 21 3d 20 6e 6f | 45 72 72 29 20 72 65 74 |rr != no|Err) ret|
|000052d0| 75 72 6e 20 65 72 72 3b | 0d 09 6c 65 6e 67 74 68 |urn err;|..length|
|000052e0| 20 3d 20 65 6e 64 20 2d | 20 73 74 61 72 74 3b 0d | = end -| start;.|
|000052f0| 09 0d 09 2f 2a 20 65 78 | 74 72 61 63 74 20 74 68 |.../* ex|tract th|
|00005300| 65 20 63 68 61 6e 67 65 | 20 63 6f 6d 6d 65 6e 74 |e change| comment|
|00005310| 20 2a 2f 0d 09 68 20 3d | 20 54 65 6d 70 4e 65 77 | */..h =| TempNew|
|00005320| 48 61 6e 64 6c 65 28 65 | 6e 64 20 2d 20 73 74 61 |Handle(e|nd - sta|
|00005330| 72 74 2c 20 26 65 72 72 | 29 3b 0d 09 69 66 20 28 |rt, &err|);..if (|
|00005340| 65 72 72 20 21 3d 20 6e | 6f 45 72 72 29 20 72 65 |err != n|oErr) re|
|00005350| 74 75 72 6e 20 65 72 72 | 3b 0d 09 42 6c 6f 63 6b |turn err|;..Block|
|00005360| 4d 6f 76 65 44 61 74 61 | 28 28 2a 68 65 61 64 65 |MoveData|((*heade|
|00005370| 72 29 20 2b 20 73 74 61 | 72 74 2c 20 2a 68 2c 20 |r) + sta|rt, *h, |
|00005380| 6c 65 6e 67 74 68 29 3b | 0d 09 0d 09 2f 2a 20 73 |length);|..../* s|
|00005390| 74 72 69 70 20 74 68 65 | 20 72 65 76 69 73 69 6f |trip the| revisio|
|000053a0| 6e 20 6e 75 6d 62 65 72 | 2c 20 69 6e 69 74 69 61 |n number|, initia|
|000053b0| 6c 73 2c 20 61 6e 64 20 | 64 61 74 65 20 2a 2f 0d |ls, and |date */.|
|000053c0| 09 73 74 61 74 65 20 3d | 20 48 47 65 74 53 74 61 |.state =| HGetSta|
|000053d0| 74 65 28 68 29 3b 0d 09 | 48 4c 6f 63 6b 28 68 29 |te(h);..|HLock(h)|
|000053e0| 3b 0d 09 67 6f 74 50 6c | 75 73 53 69 67 6e 20 3d |;..gotPl|usSign =|
|000053f0| 20 66 61 6c 73 65 3b 0d | 09 66 6f 72 20 28 69 20 | false;.|.for (i |
|00005400| 3d 20 30 2c 20 73 20 3d | 20 2a 68 3b 20 69 20 3c |= 0, s =| *h; i <|
|00005410| 20 6c 65 6e 67 74 68 20 | 26 26 20 2a 73 20 21 3d | length |&& *s !=|
|00005420| 20 27 3e 27 3b 20 69 2b | 2b 2c 20 73 2b 2b 29 0d | '>'; i+|+, s++).|
|00005430| 09 09 69 66 20 28 2a 73 | 20 3d 3d 20 27 2b 27 29 |..if (*s| == '+')|
|00005440| 20 67 6f 74 50 6c 75 73 | 53 69 67 6e 20 3d 20 74 | gotPlus|Sign = t|
|00005450| 72 75 65 3b 0d 09 09 2f | 2a 20 73 74 72 69 70 20 |rue;.../|* strip |
|00005460| 74 6f 20 65 6e 64 20 6f | 66 20 72 65 76 69 73 69 |to end o|f revisi|
|00005470| 6f 6e 20 6e 75 6d 62 65 | 72 20 2d 2d 20 72 69 67 |on numbe|r -- rig|
|00005480| 68 74 20 61 6e 67 6c 65 | 20 62 72 61 63 6b 65 74 |ht angle| bracket|
|00005490| 20 2a 2f 0d 09 69 66 20 | 28 21 67 6f 74 50 6c 75 | */..if |(!gotPlu|
|000054a0| 73 53 69 67 6e 29 0d 09 | 7b 0d 09 09 63 6f 6d 6d |sSign)..|{...comm|
|000054b0| 65 6e 74 5b 30 5d 20 3d | 20 30 3b 0d 09 09 44 69 |ent[0] =| 0;...Di|
|000054c0| 73 70 6f 73 65 48 61 6e | 64 6c 65 28 68 29 3b 0d |sposeHan|dle(h);.|
|000054d0| 09 09 72 65 74 75 72 6e | 20 6e 6f 45 72 72 3b 0d |..return| noErr;.|
|000054e0| 09 7d 0d 09 66 6f 72 20 | 28 73 2b 2b 3b 20 69 20 |.}..for |(s++; i |
|000054f0| 3c 20 6c 65 6e 67 74 68 | 20 26 26 20 28 2a 73 20 |< length| && (*s |
|00005500| 3d 3d 20 27 5c 74 27 20 | 7c 7c 20 2a 73 20 3d 3d |== '\t' ||| *s ==|
|00005510| 20 27 20 27 29 3b 20 69 | 2b 2b 2c 20 73 2b 2b 29 | ' '); i|++, s++)|
|00005520| 0d 09 09 3b 20 2f 2a 20 | 73 74 72 69 70 20 74 61 |...; /* |strip ta|
|00005530| 62 73 20 61 6e 64 20 73 | 70 61 63 65 73 20 2a 2f |bs and s|paces */|
|00005540| 0d 09 66 6f 72 20 28 20 | 3b 20 69 20 3c 20 6c 65 |..for ( |; i < le|
|00005550| 6e 67 74 68 20 26 26 20 | 28 2a 73 20 21 3d 20 27 |ngth && |(*s != '|
|00005560| 5c 74 27 29 20 26 26 20 | 28 2a 73 20 21 3d 20 27 |\t') && |(*s != '|
|00005570| 20 27 29 3b 20 69 2b 2b | 2c 20 73 2b 2b 29 0d 09 | '); i++|, s++)..|
|00005580| 09 3b 20 2f 2a 20 73 74 | 72 69 70 20 6e 6f 6e 2d |.; /* st|rip non-|
|00005590| 77 68 69 74 65 2d 73 70 | 61 63 65 20 28 64 61 74 |white-sp|ace (dat|
|000055a0| 65 29 20 2a 2f 0d 09 66 | 6f 72 20 28 20 3b 20 69 |e) */..f|or ( ; i|
|000055b0| 20 3c 20 6c 65 6e 67 74 | 68 20 26 26 20 28 2a 73 | < lengt|h && (*s|
|000055c0| 20 3d 3d 20 27 5c 74 27 | 20 7c 7c 20 2a 73 20 3d | == '\t'| || *s =|
|000055d0| 3d 20 27 20 27 29 3b 20 | 69 2b 2b 2c 20 73 2b 2b |= ' '); |i++, s++|
|000055e0| 29 0d 09 09 3b 20 2f 2a | 20 73 74 72 69 70 20 74 |)...; /*| strip t|
|000055f0| 61 62 73 20 61 6e 64 20 | 73 70 61 63 65 73 20 2a |abs and |spaces *|
|00005600| 2f 0d 09 66 6f 72 20 28 | 20 3b 20 69 20 3c 20 6c |/..for (| ; i < l|
|00005610| 65 6e 67 74 68 20 26 26 | 20 28 2a 73 20 21 3d 20 |ength &&| (*s != |
|00005620| 27 5c 74 27 29 20 26 26 | 20 28 2a 73 20 21 3d 20 |'\t') &&| (*s != |
|00005630| 27 20 27 29 3b 20 69 2b | 2b 2c 20 73 2b 2b 29 0d |' '); i+|+, s++).|
|00005640| 09 09 3b 20 2f 2a 20 73 | 74 72 69 70 20 6e 6f 6e |..; /* s|trip non|
|00005650| 2d 77 68 69 74 65 2d 73 | 70 61 63 65 20 28 69 6e |-white-s|pace (in|
|00005660| 69 74 69 61 6c 73 29 20 | 2a 2f 0d 09 66 6f 72 20 |itials) |*/..for |
|00005670| 28 20 3b 20 69 20 3c 20 | 6c 65 6e 67 74 68 20 26 |( ; i < |length &|
|00005680| 26 20 28 2a 73 20 3d 3d | 20 27 5c 74 27 20 7c 7c |& (*s ==| '\t' |||
|00005690| 20 2a 73 20 3d 3d 20 27 | 20 27 29 3b 20 69 2b 2b | *s == '| '); i++|
|000056a0| 2c 20 73 2b 2b 29 0d 09 | 09 3b 20 2f 2a 20 73 74 |, s++)..|.; /* st|
|000056b0| 72 69 70 20 74 61 62 73 | 20 61 6e 64 20 73 70 61 |rip tabs| and spa|
|000056c0| 63 65 73 20 2a 2f 0d 09 | 73 74 72 69 70 4c 65 6e |ces */..|stripLen|
|000056d0| 67 74 68 20 3d 20 28 73 | 20 2d 20 2a 68 29 3b 0d |gth = (s| - *h);.|
|000056e0| 09 48 53 65 74 53 74 61 | 74 65 28 68 2c 20 73 74 |.HSetSta|te(h, st|
|000056f0| 61 74 65 29 3b 0d 09 69 | 66 20 28 6c 65 6e 67 74 |ate);..i|f (lengt|
|00005700| 68 20 3e 20 73 74 72 69 | 70 4c 65 6e 67 74 68 29 |h > stri|pLength)|
|00005710| 0d 09 7b 0d 09 09 6c 65 | 6e 67 74 68 20 2d 3d 20 |..{...le|ngth -= |
|00005720| 73 74 72 69 70 4c 65 6e | 67 74 68 3b 0d 09 09 42 |stripLen|gth;...B|
|00005730| 6c 6f 63 6b 4d 6f 76 65 | 44 61 74 61 28 2a 68 20 |lockMove|Data(*h |
|00005740| 2b 20 73 74 72 69 70 4c | 65 6e 67 74 68 2c 20 2a |+ stripL|ength, *|
|00005750| 68 2c 20 6c 65 6e 67 74 | 68 29 3b 0d 09 09 53 65 |h, lengt|h);...Se|
|00005760| 74 48 61 6e 64 6c 65 53 | 69 7a 65 28 68 2c 20 6c |tHandleS|ize(h, l|
|00005770| 65 6e 67 74 68 29 3b 0d | 09 7d 0d 09 65 6c 73 65 |ength);.|.}..else|
|00005780| 0d 09 7b 0d 09 09 53 65 | 74 48 61 6e 64 6c 65 53 |..{...Se|tHandleS|
|00005790| 69 7a 65 28 68 2c 20 30 | 29 3b 0d 09 09 6c 65 6e |ize(h, 0|);...len|
|000057a0| 67 74 68 20 3d 20 30 3b | 0d 09 7d 0d 09 0d 09 2f |gth = 0;|..}..../|
|000057b0| 2a 20 73 74 72 69 70 20 | 73 74 61 72 74 20 6f 66 |* strip |start of|
|000057c0| 20 6c 69 6e 65 20 63 68 | 61 72 61 63 74 65 72 73 | line ch|aracters|
|000057d0| 20 2a 2f 0d 09 69 66 20 | 28 66 6f 72 6d 61 74 2d | */..if |(format-|
|000057e0| 3e 6c 69 6e 65 53 74 61 | 72 74 5b 30 5d 20 3e 20 |>lineSta|rt[0] > |
|000057f0| 30 29 0d 09 7b 0d 09 09 | 53 74 72 33 31 20 74 68 |0)..{...|Str31 th|
|00005800| 65 4c 69 6e 65 53 74 61 | 72 74 3b 0d 09 09 74 68 |eLineSta|rt;...th|
|00005810| 65 4c 69 6e 65 53 74 61 | 72 74 5b 30 5d 20 3d 20 |eLineSta|rt[0] = |
|00005820| 66 6f 72 6d 61 74 2d 3e | 6c 69 6e 65 53 74 61 72 |format->|lineStar|
|00005830| 74 5b 30 5d 20 2b 20 31 | 3b 0d 09 09 74 68 65 4c |t[0] + 1|;...theL|
|00005840| 69 6e 65 53 74 61 72 74 | 5b 31 5d 20 3d 20 27 5c |ineStart|[1] = '\|
|00005850| 6e 27 3b 0d 09 09 42 6c | 6f 63 6b 4d 6f 76 65 44 |n';...Bl|ockMoveD|
|00005860| 61 74 61 28 66 6f 72 6d | 61 74 2d 3e 6c 69 6e 65 |ata(form|at->line|
|00005870| 53 74 61 72 74 20 2b 20 | 31 2c 20 74 68 65 4c 69 |Start + |1, theLi|
|00005880| 6e 65 53 74 61 72 74 20 | 2b 20 32 2c 20 66 6f 72 |neStart |+ 2, for|
|00005890| 6d 61 74 2d 3e 6c 69 6e | 65 53 74 61 72 74 5b 30 |mat->lin|eStart[0|
|000058a0| 5d 29 3b 0d 09 09 77 68 | 69 6c 65 20 28 52 65 70 |]);...wh|ile (Rep|
|000058b0| 6c 61 63 65 53 74 72 69 | 6e 67 28 68 2c 20 74 68 |laceStri|ng(h, th|
|000058c0| 65 4c 69 6e 65 53 74 61 | 72 74 2c 20 22 5c 70 20 |eLineSta|rt, "\p |
|000058d0| 22 29 20 3e 20 30 29 0d | 09 09 09 3b 0d 09 7d 0d |") > 0).|...;..}.|
|000058e0| 09 0d 09 2f 2a 20 63 6f | 6d 70 72 65 73 73 20 77 |.../* co|mpress w|
|000058f0| 68 69 74 65 20 73 70 61 | 63 65 20 2a 2f 0d 09 52 |hite spa|ce */..R|
|00005900| 65 70 6c 61 63 65 53 74 | 72 69 6e 67 28 68 2c 20 |eplaceSt|ring(h, |
|00005910| 22 5c 70 5c 6e 22 2c 20 | 22 5c 70 20 22 29 3b 0d |"\p\n", |"\p ");.|
|00005920| 09 52 65 70 6c 61 63 65 | 53 74 72 69 6e 67 28 68 |.Replace|String(h|
|00005930| 2c 20 22 5c 70 5c 74 22 | 2c 20 22 5c 70 20 22 29 |, "\p\t"|, "\p ")|
|00005940| 3b 0d 09 77 68 69 6c 65 | 20 28 52 65 70 6c 61 63 |;..while| (Replac|
|00005950| 65 53 74 72 69 6e 67 28 | 68 2c 20 22 5c 70 20 20 |eString(|h, "\p |
|00005960| 22 2c 20 22 5c 70 20 22 | 29 20 3e 20 30 29 0d 09 |", "\p "|) > 0)..|
|00005970| 09 3b 0d 09 6c 65 6e 67 | 74 68 20 3d 20 47 65 74 |.;..leng|th = Get|
|00005980| 48 61 6e 64 6c 65 53 69 | 7a 65 28 68 29 3b 0d 09 |HandleSi|ze(h);..|
|00005990| 0d 09 2f 2a 20 63 6f 70 | 79 20 74 6f 20 74 68 65 |../* cop|y to the|
|000059a0| 20 63 6f 6d 6d 65 6e 74 | 20 73 74 72 69 6e 67 20 | comment| string |
|000059b0| 2a 2f 0d 09 42 6c 6f 63 | 6b 4d 6f 76 65 44 61 74 |*/..Bloc|kMoveDat|
|000059c0| 61 28 2a 68 2c 20 63 6f | 6d 6d 65 6e 74 20 2b 20 |a(*h, co|mment + |
|000059d0| 31 2c 20 6c 65 6e 67 74 | 68 29 3b 0d 09 63 6f 6d |1, lengt|h);..com|
|000059e0| 6d 65 6e 74 5b 30 5d 20 | 3d 20 6c 65 6e 67 74 68 |ment[0] |= length|
|000059f0| 3b 0d 09 44 69 73 70 6f | 73 65 48 61 6e 64 6c 65 |;..Dispo|seHandle|
|00005a00| 28 68 29 3b 0d 09 72 65 | 74 75 72 6e 20 6e 6f 45 |(h);..re|turn noE|
|00005a10| 72 72 3b 0d 7d 0d 0d 0d | 4f 53 45 72 72 20 41 64 |rr;.}...|OSErr Ad|
|00005a20| 64 43 68 61 6e 67 65 43 | 6f 6d 6d 65 6e 74 28 46 |dChangeC|omment(F|
|00005a30| 53 53 70 65 63 20 2a 66 | 69 6c 65 2c 20 43 6f 6d |SSpec *f|ile, Com|
|00005a40| 6d 65 6e 74 46 6f 72 6d | 61 74 20 2a 66 6f 72 6d |mentForm|at *form|
|00005a50| 61 74 2c 20 53 74 72 69 | 6e 67 48 61 6e 64 6c 65 |at, Stri|ngHandle|
|00005a60| 20 68 65 61 64 65 72 2c | 0d 09 09 09 09 09 09 53 | header,|.......S|
|00005a70| 74 72 69 6e 67 50 74 72 | 20 6e 69 63 6b 6e 61 6d |tringPtr| nicknam|
|00005a80| 65 2c 20 53 74 72 69 6e | 67 50 74 72 20 63 6f 6d |e, Strin|gPtr com|
|00005a90| 6d 65 6e 74 2c 20 42 6f | 6f 6c 65 61 6e 20 63 68 |ment, Bo|olean ch|
|00005aa0| 65 63 6b 69 6e 67 4f 75 | 74 29 0d 7b 0d 09 4f 53 |eckingOu|t).{..OS|
|00005ab0| 45 72 72 20 65 72 72 20 | 3d 20 6e 6f 45 72 72 3b |Err err |= noErr;|
|00005ac0| 0d 09 6c 6f 6e 67 20 73 | 74 61 72 74 2c 20 65 6e |..long s|tart, en|
|00005ad0| 64 3b 0d 09 73 68 6f 72 | 74 20 72 65 76 69 73 69 |d;..shor|t revisi|
|00005ae0| 6f 6e 3b 0d 09 53 74 72 | 69 6e 67 48 61 6e 64 6c |on;..Str|ingHandl|
|00005af0| 65 20 63 6f 6d 6d 65 6e | 74 48 61 6e 64 6c 65 20 |e commen|tHandle |
|00005b00| 3d 20 4e 55 4c 4c 3b 0d | 09 42 79 74 65 20 73 74 |= NULL;.|.Byte st|
|00005b10| 61 74 65 3b 0d 09 6c 6f | 6e 67 20 6e 65 77 43 6f |ate;..lo|ng newCo|
|00005b20| 6d 6d 65 6e 74 53 69 7a | 65 3b 0d 09 0d 09 2f 2a |mmentSiz|e;..../*|
|00005b30| 20 67 65 74 20 74 68 65 | 20 6c 6f 63 61 74 69 6f | get the| locatio|
|00005b40| 6e 20 6f 66 20 74 68 65 | 20 66 69 72 73 74 20 63 |n of the| first c|
|00005b50| 68 61 6e 67 65 20 63 6f | 6d 6d 65 6e 74 20 2a 2f |hange co|mment */|
|00005b60| 0d 09 65 72 72 20 3d 20 | 46 69 6e 64 46 69 72 73 |..err = |FindFirs|
|00005b70| 74 43 68 61 6e 67 65 43 | 6f 6d 6d 65 6e 74 28 68 |tChangeC|omment(h|
|00005b80| 65 61 64 65 72 2c 20 66 | 6f 72 6d 61 74 2c 20 26 |eader, f|ormat, &|
|00005b90| 73 74 61 72 74 2c 20 26 | 65 6e 64 29 3b 0d 09 69 |start, &|end);..i|
|00005ba0| 66 20 28 65 72 72 20 21 | 3d 20 6e 6f 45 72 72 29 |f (err !|= noErr)|
|00005bb0| 20 67 6f 74 6f 20 45 72 | 72 6f 72 45 78 69 74 3b | goto Er|rorExit;|
|00005bc0| 0d 09 0d 09 2f 2a 20 67 | 65 74 20 74 68 65 20 72 |..../* g|et the r|
|00005bd0| 65 76 69 73 69 6f 6e 20 | 6e 75 6d 62 65 72 20 66 |evision |number f|
|00005be0| 72 6f 6d 20 74 68 65 20 | 43 4b 49 44 20 2a 2f 0d |rom the |CKID */.|
|00005bf0| 09 65 72 72 20 3d 20 47 | 65 74 52 65 76 69 73 69 |.err = G|etRevisi|
|00005c00| 6f 6e 4e 75 6d 62 65 72 | 28 66 69 6c 65 2c 20 26 |onNumber|(file, &|
|00005c10| 72 65 76 69 73 69 6f 6e | 29 3b 0d 09 69 66 20 28 |revision|);..if (|
|00005c20| 65 72 72 20 21 3d 20 6e | 6f 45 72 72 29 20 67 6f |err != n|oErr) go|
|00005c30| 74 6f 20 45 72 72 6f 72 | 45 78 69 74 3b 0d 09 0d |to Error|Exit;...|
|00005c40| 09 65 72 72 20 3d 20 42 | 75 69 6c 64 43 6f 6d 6d |.err = B|uildComm|
|00005c50| 65 6e 74 28 26 63 6f 6d | 6d 65 6e 74 48 61 6e 64 |ent(&com|mentHand|
|00005c60| 6c 65 2c 20 66 6f 72 6d | 61 74 2c 20 72 65 76 69 |le, form|at, revi|
|00005c70| 73 69 6f 6e 2c 20 63 68 | 65 63 6b 69 6e 67 4f 75 |sion, ch|eckingOu|
|00005c80| 74 2c 20 63 6f 6d 6d 65 | 6e 74 2c 0d 09 09 09 09 |t, comme|nt,.....|
|00005c90| 09 09 6e 69 63 6b 6e 61 | 6d 65 29 3b 0d 09 69 66 |..nickna|me);..if|
|00005ca0| 20 28 65 72 72 20 21 3d | 20 6e 6f 45 72 72 29 20 | (err !=| noErr) |
|00005cb0| 67 6f 74 6f 20 45 72 72 | 6f 72 45 78 69 74 3b 0d |goto Err|orExit;.|
|00005cc0| 0d 09 2f 2a 20 63 68 65 | 63 6b 20 74 68 65 20 63 |../* che|ck the c|
|00005cd0| 75 72 72 65 6e 74 20 63 | 6f 6d 6d 65 6e 74 20 2d |urrent c|omment -|
|00005ce0| 2d 20 69 73 20 69 74 20 | 66 6f 72 20 74 68 69 73 |- is it |for this|
|00005cf0| 20 72 65 76 69 73 69 6f | 6e 20 77 69 74 68 20 61 | revisio|n with a|
|00005d00| 20 70 6c 75 73 20 73 69 | 67 6e 3f 0d 09 20 2a 20 | plus si|gn?.. * |
|00005d10| 69 66 20 73 6f 2c 20 64 | 65 6c 65 74 65 20 69 74 |if so, d|elete it|
|00005d20| 2e 20 74 68 69 73 20 69 | 73 20 6f 6e 6c 79 20 77 |. this i|s only w|
|00005d30| 68 65 6e 20 63 68 65 63 | 6b 69 6e 67 20 69 6e 2e |hen chec|king in.|
|00005d40| 2e 2e 0d 09 20 2a 2f 0d | 09 73 74 61 74 65 20 3d |.... */.|.state =|
|00005d50| 20 48 47 65 74 53 74 61 | 74 65 28 68 65 61 64 65 | HGetSta|te(heade|
|00005d60| 72 29 3b 0d 09 48 4c 6f | 63 6b 28 68 65 61 64 65 |r);..HLo|ck(heade|
|00005d70| 72 29 3b 0d 09 48 4c 6f | 63 6b 28 63 6f 6d 6d 65 |r);..HLo|ck(comme|
|00005d80| 6e 74 48 61 6e 64 6c 65 | 29 3b 20 2f 2a 20 70 65 |ntHandle|); /* pe|
|00005d90| 72 6d 61 6e 65 6e 74 20 | 6c 6f 63 6b 20 2d 2d 20 |rmanent |lock -- |
|00005da0| 64 69 73 70 6f 73 65 64 | 20 61 20 6c 69 74 74 6c |disposed| a littl|
|00005db0| 65 20 6c 61 74 65 72 20 | 2a 2f 0d 09 6e 65 77 43 |e later |*/..newC|
|00005dc0| 6f 6d 6d 65 6e 74 53 69 | 7a 65 20 3d 20 47 65 74 |ommentSi|ze = Get|
|00005dd0| 48 61 6e 64 6c 65 53 69 | 7a 65 28 63 6f 6d 6d 65 |HandleSi|ze(comme|
|00005de0| 6e 74 48 61 6e 64 6c 65 | 29 3b 0d 09 0d 09 69 66 |ntHandle|);....if|
|00005df0| 20 28 21 63 68 65 63 6b | 69 6e 67 4f 75 74 29 0d | (!check|ingOut).|
|00005e00| 09 7b 0d 09 09 2f 2a 20 | 63 68 65 63 6b 20 74 6f |.{.../* |check to|
|00005e10| 20 73 65 65 20 69 66 20 | 74 68 65 20 63 75 72 72 | see if |the curr|
|00005e20| 65 6e 74 20 63 6f 6d 6d | 65 6e 74 20 69 73 20 66 |ent comm|ent is f|
|00005e30| 6f 72 20 74 68 69 73 20 | 72 65 76 69 73 69 6f 6e |or this |revision|
|00005e40| 20 2a 2f 0d 09 09 53 74 | 72 69 6e 67 50 74 72 20 | */...St|ringPtr |
|00005e50| 73 3b 0d 09 09 6c 6f 6e | 67 20 69 3b 0d 09 09 0d |s;...lon|g i;....|
|00005e60| 09 09 66 6f 72 20 28 69 | 20 3d 20 30 2c 20 73 20 |..for (i| = 0, s |
|00005e70| 3d 20 28 2a 68 65 61 64 | 65 72 29 20 2b 20 73 74 |= (*head|er) + st|
|00005e80| 61 72 74 3b 20 69 20 3c | 20 65 6e 64 20 2d 20 73 |art; i <| end - s|
|00005e90| 74 61 72 74 20 26 26 20 | 2a 73 20 21 3d 20 27 3c |tart && |*s != '<|
|00005ea0| 27 3b 20 69 2b 2b 2c 20 | 73 2b 2b 29 0d 09 09 09 |'; i++, |s++)....|
|00005eb0| 3b 0d 09 09 69 66 20 28 | 69 20 3c 20 65 6e 64 20 |;...if (|i < end |
|00005ec0| 2d 20 73 74 61 72 74 20 | 26 26 20 2a 73 20 3d 3d |- start |&& *s ==|
|00005ed0| 20 27 3c 27 29 0d 09 09 | 7b 0d 09 09 09 53 74 72 | '<')...|{....Str|
|00005ee0| 33 31 20 6e 75 6d 62 65 | 72 53 74 72 69 6e 67 3b |31 numbe|rString;|
|00005ef0| 0d 09 09 09 6c 6f 6e 67 | 20 74 68 65 4e 75 6d 62 |....long| theNumb|
|00005f00| 65 72 3b 0d 09 09 09 0d | 09 09 09 6e 75 6d 62 65 |er;.....|...numbe|
|00005f10| 72 53 74 72 69 6e 67 5b | 30 5d 20 3d 20 30 3b 0d |rString[|0] = 0;.|
|00005f20| 09 09 09 66 6f 72 20 28 | 73 2b 2b 2c 20 69 2b 2b |...for (|s++, i++|
|00005f30| 3b 20 69 20 3c 20 65 6e | 64 20 2d 20 73 74 61 72 |; i < en|d - star|
|00005f40| 74 20 26 26 20 2a 73 20 | 3e 3d 20 27 30 27 20 26 |t && *s |>= '0' &|
|00005f50| 26 20 2a 73 20 3c 3d 20 | 27 39 27 3b 20 69 2b 2b |& *s <= |'9'; i++|
|00005f60| 2c 20 73 2b 2b 29 0d 09 | 09 09 09 6e 75 6d 62 65 |, s++)..|...numbe|
|00005f70| 72 53 74 72 69 6e 67 5b | 2b 2b 6e 75 6d 62 65 72 |rString[|++number|
|00005f80| 53 74 72 69 6e 67 5b 30 | 5d 5d 20 3d 20 2a 73 3b |String[0|]] = *s;|
|00005f90| 0d 09 09 09 53 74 72 69 | 6e 67 54 6f 4e 75 6d 28 |....Stri|ngToNum(|
|00005fa0| 6e 75 6d 62 65 72 53 74 | 72 69 6e 67 2c 20 26 74 |numberSt|ring, &t|
|00005fb0| 68 65 4e 75 6d 62 65 72 | 29 3b 0d 09 09 09 69 66 |heNumber|);....if|
|00005fc0| 20 28 74 68 65 4e 75 6d | 62 65 72 20 3d 3d 20 72 | (theNum|ber == r|
|00005fd0| 65 76 69 73 69 6f 6e 20 | 26 26 20 2a 73 20 3d 3d |evision |&& *s ==|
|00005fe0| 20 27 2b 27 20 26 26 20 | 69 20 3c 20 65 6e 64 20 | '+' && |i < end |
|00005ff0| 2d 20 73 74 61 72 74 29 | 0d 09 09 09 7b 0d 09 09 |- start)|....{...|
|00006000| 09 09 2f 2a 20 64 65 6c | 65 74 65 20 74 68 65 20 |../* del|ete the |
|00006010| 63 75 72 72 65 6e 74 20 | 63 6f 6d 6d 65 6e 74 20 |current |comment |
|00006020| 2a 2f 0d 09 09 09 09 4d | 75 6e 67 65 72 28 68 65 |*/.....M|unger(he|
|00006030| 61 64 65 72 2c 20 73 74 | 61 72 74 2c 20 4e 55 4c |ader, st|art, NUL|
|00006040| 4c 2c 20 28 65 6e 64 20 | 2d 20 73 74 61 72 74 29 |L, (end |- start)|
|00006050| 20 2b 20 31 2c 20 2a 63 | 6f 6d 6d 65 6e 74 48 61 | + 1, *c|ommentHa|
|00006060| 6e 64 6c 65 2c 20 30 29 | 3b 0d 09 09 09 7d 0d 09 |ndle, 0)|;....}..|
|00006070| 09 7d 0d 09 7d 0d 09 0d | 09 2f 2a 20 6e 6f 77 20 |.}..}...|./* now |
|00006080| 61 64 64 20 74 68 65 20 | 63 6f 6d 6d 65 6e 74 20 |add the |comment |
|00006090| 61 74 20 6f 66 66 73 65 | 74 20 22 73 74 61 72 74 |at offse|t "start|
|000060a0| 22 20 2a 2f 0d 09 48 55 | 6e 6c 6f 63 6b 28 68 65 |" */..HU|nlock(he|
|000060b0| 61 64 65 72 29 3b 20 2f | 2a 20 6e 65 65 64 73 20 |ader); /|* needs |
|000060c0| 74 6f 20 62 65 20 75 6e | 6c 6f 63 6b 65 64 20 66 |to be un|locked f|
|000060d0| 6f 72 20 4d 75 6e 67 65 | 72 21 20 2a 2f 0d 09 4d |or Munge|r! */..M|
|000060e0| 75 6e 67 65 72 28 68 65 | 61 64 65 72 2c 20 73 74 |unger(he|ader, st|
|000060f0| 61 72 74 2c 20 4e 55 4c | 4c 2c 20 30 2c 20 2a 63 |art, NUL|L, 0, *c|
|00006100| 6f 6d 6d 65 6e 74 48 61 | 6e 64 6c 65 2c 20 6e 65 |ommentHa|ndle, ne|
|00006110| 77 43 6f 6d 6d 65 6e 74 | 53 69 7a 65 29 3b 0d 09 |wComment|Size);..|
|00006120| 0d 09 2f 2a 20 63 6c 65 | 61 6e 20 75 70 20 61 6e |../* cle|an up an|
|00006130| 64 20 67 6f 20 61 77 61 | 79 20 2a 2f 0d 09 48 53 |d go awa|y */..HS|
|00006140| 65 74 53 74 61 74 65 28 | 68 65 61 64 65 72 2c 20 |etState(|header, |
|00006150| 73 74 61 74 65 29 3b 0d | 09 44 69 73 70 6f 73 65 |state);.|.Dispose|
|00006160| 48 61 6e 64 6c 65 28 63 | 6f 6d 6d 65 6e 74 48 61 |Handle(c|ommentHa|
|00006170| 6e 64 6c 65 29 3b 0d 09 | 72 65 74 75 72 6e 20 6e |ndle);..|return n|
|00006180| 6f 45 72 72 3b 0d 0d 45 | 72 72 6f 72 45 78 69 74 |oErr;..E|rrorExit|
|00006190| 3a 0d 09 69 66 20 28 63 | 6f 6d 6d 65 6e 74 48 61 |:..if (c|ommentHa|
|000061a0| 6e 64 6c 65 20 21 3d 20 | 4e 55 4c 4c 29 0d 09 09 |ndle != |NULL)...|
|000061b0| 44 69 73 70 6f 73 65 48 | 61 6e 64 6c 65 28 63 6f |DisposeH|andle(co|
|000061c0| 6d 6d 65 6e 74 48 61 6e | 64 6c 65 29 3b 0d 09 72 |mmentHan|dle);..r|
|000061d0| 65 74 75 72 6e 20 65 72 | 72 3b 0d 7d 0d 0d 0d 4f |eturn er|r;.}...O|
|000061e0| 53 45 72 72 20 41 64 64 | 46 69 72 73 74 54 69 6d |SErr Add|FirstTim|
|000061f0| 65 48 65 61 64 65 72 28 | 46 53 53 70 65 63 20 2a |eHeader(|FSSpec *|
|00006200| 66 69 6c 65 2c 20 53 74 | 72 69 6e 67 50 74 72 20 |file, St|ringPtr |
|00006210| 75 73 65 72 4e 61 6d 65 | 2c 20 53 74 72 69 6e 67 |userName|, String|
|00006220| 50 74 72 20 6e 69 63 6b | 6e 61 6d 65 2c 20 53 74 |Ptr nick|name, St|
|00006230| 72 69 6e 67 50 74 72 20 | 63 6f 6d 6d 65 6e 74 29 |ringPtr |comment)|
|00006240| 0d 7b 0d 09 53 74 72 69 | 6e 67 48 61 6e 64 6c 65 |.{..Stri|ngHandle|
|00006250| 20 68 65 61 64 65 72 20 | 3d 20 4e 55 4c 4c 3b 0d | header |= NULL;.|
|00006260| 09 43 6f 6d 6d 65 6e 74 | 46 6f 72 6d 61 74 20 2a |.Comment|Format *|
|00006270| 66 6f 72 6d 61 74 20 3d | 20 4e 55 4c 4c 3b 0d 09 |format =| NULL;..|
|00006280| 48 61 6e 64 6c 65 20 66 | 69 6c 65 44 61 74 61 3b |Handle f|ileData;|
|00006290| 0d 09 73 68 6f 72 74 20 | 72 65 66 4e 75 6d 3b 0d |..short |refNum;.|
|000062a0| 09 4f 53 45 72 72 20 65 | 72 72 3b 0d 0d 09 2f 2a |.OSErr e|rr;.../*|
|000062b0| 20 69 73 20 69 74 20 61 | 20 74 65 78 74 20 66 69 | is it a| text fi|
|000062c0| 6c 65 3f 20 69 66 20 6e | 6f 74 2c 20 6e 6f 74 68 |le? if n|ot, noth|
|000062d0| 69 6e 67 20 74 6f 20 64 | 6f 20 2a 2f 0d 09 69 66 |ing to d|o */..if|
|000062e0| 20 28 21 49 73 54 65 78 | 74 46 69 6c 65 28 66 69 | (!IsTex|tFile(fi|
|000062f0| 6c 65 29 29 0d 09 09 72 | 65 74 75 72 6e 20 6e 6f |le))...r|eturn no|
|00006300| 45 72 72 3b 0d 09 0d 09 | 2f 2a 20 64 6f 65 73 20 |Err;....|/* does |
|00006310| 74 68 65 20 75 73 65 72 | 20 63 6f 6e 66 69 72 6d |the user| confirm|
|00006320| 20 74 68 61 74 20 61 20 | 68 65 61 64 65 72 20 73 | that a |header s|
|00006330| 68 6f 75 6c 64 20 62 65 | 20 61 64 64 65 64 3f 20 |hould be| added? |
|00006340| 2a 2f 0d 09 73 77 69 74 | 63 68 20 28 52 65 73 54 |*/..swit|ch (ResT|
|00006350| 65 78 74 59 65 73 4e 6f | 43 61 6e 63 65 6c 28 6b |extYesNo|Cancel(k|
|00006360| 50 72 6f 6a 65 63 74 44 | 72 61 67 53 74 72 69 6e |ProjectD|ragStrin|
|00006370| 67 73 2c 20 6b 41 64 64 | 48 65 61 64 65 72 2c 20 |gs, kAdd|Header, |
|00006380| 66 69 6c 65 2d 3e 6e 61 | 6d 65 2c 20 4e 55 4c 4c |file->na|me, NULL|
|00006390| 2c 20 4e 55 4c 4c 2c 20 | 4e 55 4c 4c 29 29 0d 09 |, NULL, |NULL))..|
|000063a0| 7b 0d 09 63 61 73 65 20 | 6b 43 6f 6e 66 69 72 6d |{..case |kConfirm|
|000063b0| 59 65 73 3a 0d 09 09 62 | 72 65 61 6b 3b 0d 09 63 |Yes:...b|reak;..c|
|000063c0| 61 73 65 20 6b 43 6f 6e | 66 69 72 6d 4e 6f 3a 0d |ase kCon|firmNo:.|
|000063d0| 09 09 72 65 74 75 72 6e | 20 6e 6f 45 72 72 3b 0d |..return| noErr;.|
|000063e0| 09 63 61 73 65 20 6b 43 | 6f 6e 66 69 72 6d 43 61 |.case kC|onfirmCa|
|000063f0| 6e 63 65 6c 3a 0d 09 09 | 72 65 74 75 72 6e 20 75 |ncel:...|return u|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.